9
9
#endif
10
10
11
11
// Regression test for https://github.com/apple/swift-corelibs-xctest/pull/7
12
+ // and https://github.com/apple/swift-corelibs-xctest/pull/294
12
13
13
14
// CHECK: Test Suite 'All tests' started at \d+-\d+-\d+ \d+:\d+:\d+\.\d+
14
15
// CHECK: Test Suite '.*\.xctest' started at \d+-\d+-\d+ \d+:\d+:\d+\.\d+
@@ -21,6 +22,10 @@ class NegativeAccuracyTestCase: XCTestCase {
21
22
( " test_equalWithAccuracy_fails " , test_equalWithAccuracy_fails) ,
22
23
( " test_notEqualWithAccuracy_passes " , test_notEqualWithAccuracy_passes) ,
23
24
( " test_notEqualWithAccuracy_fails " , test_notEqualWithAccuracy_fails) ,
25
+ ( " test_equalWithAccuracy_int_passes " , test_equalWithAccuracy_int_passes) ,
26
+ ( " test_equalWithAccuracy_int_fails " , test_equalWithAccuracy_int_fails) ,
27
+ ( " test_notEqualWithAccuracy_int_passes " , test_notEqualWithAccuracy_int_passes) ,
28
+ ( " test_notEqualWithAccuracy_int_fails " , test_notEqualWithAccuracy_int_fails) ,
24
29
]
25
30
} ( )
26
31
@@ -31,7 +36,7 @@ class NegativeAccuracyTestCase: XCTestCase {
31
36
}
32
37
33
38
// CHECK: Test Case 'NegativeAccuracyTestCase.test_equalWithAccuracy_fails' started at \d+-\d+-\d+ \d+:\d+:\d+\.\d+
34
- // CHECK: .*[/\\]NegativeAccuracyTestCase[/\\]main.swift:[[@LINE+3]]: error: NegativeAccuracyTestCase.test_equalWithAccuracy_fails : XCTAssertEqual failed: \(\ "0\.0\ "\) is not equal to \(\ "0\.2\ "\) \+\/- \(\ "-0\.1\ "\) - $
39
+ // CHECK: .*[/\\]NegativeAccuracyTestCase[/\\]main.swift:[[@LINE+3]]: error: NegativeAccuracyTestCase.test_equalWithAccuracy_fails : XCTAssertEqual failed: \("0\.0"\) is not equal to \("0\.2"\) \+\/- \("-0\.1"\) - $
35
40
// CHECK: Test Case 'NegativeAccuracyTestCase.test_equalWithAccuracy_fails' failed \(\d+\.\d+ seconds\)
36
41
func test_equalWithAccuracy_fails( ) {
37
42
XCTAssertEqual ( 0 , 0.2 , accuracy: - 0.1 )
@@ -40,22 +45,49 @@ class NegativeAccuracyTestCase: XCTestCase {
40
45
// CHECK: Test Case 'NegativeAccuracyTestCase.test_notEqualWithAccuracy_passes' started at \d+-\d+-\d+ \d+:\d+:\d+\.\d+
41
46
// CHECK: Test Case 'NegativeAccuracyTestCase.test_notEqualWithAccuracy_passes' passed \(\d+\.\d+ seconds\)
42
47
func test_notEqualWithAccuracy_passes( ) {
43
- XCTAssertNotEqual ( 1 , 2 , accuracy: - 0.5 )
48
+ XCTAssertNotEqual ( 1.0 , 2.0 , accuracy: - 0.5 )
44
49
}
45
50
46
51
// CHECK: Test Case 'NegativeAccuracyTestCase.test_notEqualWithAccuracy_fails' started at \d+-\d+-\d+ \d+:\d+:\d+\.\d+
47
52
// CHECK: .*[/\\]NegativeAccuracyTestCase[/\\]main.swift:[[@LINE+3]]: error: NegativeAccuracyTestCase.test_notEqualWithAccuracy_fails : XCTAssertNotEqual failed: \("1\.0"\) is equal to \("2\.0"\) \+/- \("-1\.0"\) - $
48
53
// CHECK: Test Case 'NegativeAccuracyTestCase.test_notEqualWithAccuracy_fails' failed \(\d+\.\d+ seconds\)
49
54
func test_notEqualWithAccuracy_fails( ) {
50
- XCTAssertNotEqual ( 1 , 2 , accuracy: - 1 )
55
+ XCTAssertNotEqual ( 1.0 , 2.0 , accuracy: - 1.0 )
51
56
}
57
+
58
+ // CHECK: Test Case 'NegativeAccuracyTestCase.test_equalWithAccuracy_int_passes' started at \d+-\d+-\d+ \d+:\d+:\d+\.\d+
59
+ // CHECK: Test Case 'NegativeAccuracyTestCase.test_equalWithAccuracy_int_passes' passed \(\d+\.\d+ seconds\)
60
+ func test_equalWithAccuracy_int_passes( ) {
61
+ XCTAssertEqual ( 10 , 11 , accuracy: 1 )
62
+ }
63
+
64
+ // CHECK: Test Case 'NegativeAccuracyTestCase.test_equalWithAccuracy_int_fails' started at \d+-\d+-\d+ \d+:\d+:\d+\.\d+
65
+ // CHECK: .*[/\\]NegativeAccuracyTestCase[/\\]main.swift:[[@LINE+3]]: error: NegativeAccuracyTestCase.test_equalWithAccuracy_int_fails : XCTAssertEqual failed: \("10"\) is not equal to \("8"\) \+\/- \("1"\) - $
66
+ // CHECK: Test Case 'NegativeAccuracyTestCase.test_equalWithAccuracy_int_fails' failed \(\d+\.\d+ seconds\)
67
+ func test_equalWithAccuracy_int_fails( ) {
68
+ XCTAssertEqual ( 10 , 8 , accuracy: 1 )
69
+ }
70
+
71
+ // CHECK: Test Case 'NegativeAccuracyTestCase.test_notEqualWithAccuracy_int_passes' started at \d+-\d+-\d+ \d+:\d+:\d+\.\d+
72
+ // CHECK: Test Case 'NegativeAccuracyTestCase.test_notEqualWithAccuracy_int_passes' passed \(\d+\.\d+ seconds\)
73
+ func test_notEqualWithAccuracy_int_passes( ) {
74
+ XCTAssertNotEqual ( - 1 , 5 , accuracy: 5 )
75
+ }
76
+
77
+ // CHECK: Test Case 'NegativeAccuracyTestCase.test_notEqualWithAccuracy_int_fails' started at \d+-\d+-\d+ \d+:\d+:\d+\.\d+
78
+ // CHECK: .*[/\\]NegativeAccuracyTestCase[/\\]main.swift:[[@LINE+3]]: error: NegativeAccuracyTestCase.test_notEqualWithAccuracy_int_fails : XCTAssertNotEqual failed: \("0"\) is equal to \("5"\) \+/- \("5"\) - $
79
+ // CHECK: Test Case 'NegativeAccuracyTestCase.test_notEqualWithAccuracy_int_fails' failed \(\d+\.\d+ seconds\)
80
+ func test_notEqualWithAccuracy_int_fails( ) {
81
+ XCTAssertNotEqual ( 0 , 5 , accuracy: 5 )
82
+ }
83
+
52
84
}
53
85
// CHECK: Test Suite 'NegativeAccuracyTestCase' failed at \d+-\d+-\d+ \d+:\d+:\d+\.\d+
54
- // CHECK: \t Executed 4 tests, with 2 failures \(0 unexpected\) in \d+\.\d+ \(\d+\.\d+\) seconds
86
+ // CHECK: \t Executed 8 tests, with 4 failures \(0 unexpected\) in \d+\.\d+ \(\d+\.\d+\) seconds
55
87
56
88
XCTMain ( [ testCase ( NegativeAccuracyTestCase . allTests) ] )
57
89
58
90
// CHECK: Test Suite '.*\.xctest' failed at \d+-\d+-\d+ \d+:\d+:\d+\.\d+
59
- // CHECK: \t Executed 4 tests, with 2 failures \(0 unexpected\) in \d+\.\d+ \(\d+\.\d+\) seconds
91
+ // CHECK: \t Executed 8 tests, with 4 failures \(0 unexpected\) in \d+\.\d+ \(\d+\.\d+\) seconds
60
92
// CHECK: Test Suite 'All tests' failed at \d+-\d+-\d+ \d+:\d+:\d+\.\d+
61
- // CHECK: \t Executed 4 tests, with 2 failures \(0 unexpected\) in \d+\.\d+ \(\d+\.\d+\) seconds
93
+ // CHECK: \t Executed 8 tests, with 4 failures \(0 unexpected\) in \d+\.\d+ \(\d+\.\d+\) seconds
0 commit comments