Skip to content

Commit 2b32c53

Browse files
committed
Take advantage of the new whitespace behavior in our test expectations
1 parent 0503412 commit 2b32c53

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

Tests/Functional/ErrorHandling/main.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class ErrorHandling: XCTestCase {
3737
}
3838

3939
// CHECK: Test Case 'ErrorHandling.test_shouldButDoesNotThrowErrorInAssertion' started.
40-
// CHECK: .*/ErrorHandling/main.swift:\d+: error: ErrorHandling.test_shouldButDoesNotThrowErrorInAssertion : XCTAssertThrowsError failed: did not throw error -
40+
// CHECK: .*/ErrorHandling/main.swift:\d+: error: ErrorHandling.test_shouldButDoesNotThrowErrorInAssertion : XCTAssertThrowsError failed: did not throw error -
4141
// CHECK: Test Case 'ErrorHandling.test_shouldButDoesNotThrowErrorInAssertion' failed \(\d+\.\d+ seconds\).
4242
func test_shouldButDoesNotThrowErrorInAssertion() {
4343
XCTAssertThrowsError(try functionThatDoesNotThrowError())
@@ -60,7 +60,7 @@ class ErrorHandling: XCTestCase {
6060
}
6161

6262
// CHECK: Test Case 'ErrorHandling.test_throwsErrorInAssertionButFailsWhenCheckingError' started.
63-
// CHECK: .*/ErrorHandling/main.swift:\d+: error: ErrorHandling.test_throwsErrorInAssertionButFailsWhenCheckingError : XCTAssertEqual failed: \("Optional\("an error message"\)"\) is not equal to \("Optional\(""\)"\) -
63+
// CHECK: .*/ErrorHandling/main.swift:\d+: error: ErrorHandling.test_throwsErrorInAssertionButFailsWhenCheckingError : XCTAssertEqual failed: \("Optional\("an error message"\)"\) is not equal to \("Optional\(""\)"\) -
6464
// CHECK: Test Case 'ErrorHandling.test_throwsErrorInAssertionButFailsWhenCheckingError' failed \(\d+\.\d+ seconds\).
6565
func test_throwsErrorInAssertionButFailsWhenCheckingError() {
6666
XCTAssertThrowsError(try functionThatDoesThrowError()) { error in
@@ -77,7 +77,7 @@ class ErrorHandling: XCTestCase {
7777
}
7878

7979
// CHECK: Test Case 'ErrorHandling.test_canAndDoesThrowErrorFromTestMethod' started.
80-
// CHECK: \<EXPR\>:0: unexpected error: ErrorHandling.test_canAndDoesThrowErrorFromTestMethod : threw error "AnError\("an error message"\)" -
80+
// CHECK: \<EXPR\>:0: unexpected error: ErrorHandling.test_canAndDoesThrowErrorFromTestMethod : threw error "AnError\("an error message"\)" -
8181
// CHECK: Test Case 'ErrorHandling.test_canAndDoesThrowErrorFromTestMethod' failed \(\d+\.\d+ seconds\).
8282
func test_canAndDoesThrowErrorFromTestMethod() throws {
8383
try functionThatDoesThrowError()
@@ -94,7 +94,7 @@ class ErrorHandling: XCTestCase {
9494
}
9595

9696
// CHECK: Test Case 'ErrorHandling.test_assertionExpressionCanThrow' started.
97-
// CHECK: .*/ErrorHandling/main.swift:\d+: unexpected error: ErrorHandling.test_assertionExpressionCanThrow : XCTAssertEqual threw error "AnError\("did not actually return"\)" -
97+
// CHECK: .*/ErrorHandling/main.swift:\d+: unexpected error: ErrorHandling.test_assertionExpressionCanThrow : XCTAssertEqual threw error "AnError\("did not actually return"\)" -
9898
// CHECK: Test Case 'ErrorHandling.test_assertionExpressionCanThrow' failed \(\d+\.\d+ seconds\).
9999
func test_assertionExpressionCanThrow() {
100100
XCTAssertEqual(try functionThatShouldReturnButThrows(), 1)

Tests/Functional/SelectedTest/main.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// RUN: %{built_tests_dir}/SelectedTest SelectedTest.ExecutedTestCase/test_foo > %T/one_test_method || true
33
// RUN: %{built_tests_dir}/SelectedTest SelectedTest.ExecutedTestCase > %T/one_test_case || true
44
// RUN: %{built_tests_dir}/SelectedTest > %T/all || true
5-
// RUN: %{xctest_checker} -p "// CHECK-METHOD: " %T/one_test_method %s
6-
// RUN: %{xctest_checker} -p "// CHECK-TESTCASE: " %T/one_test_case %s
7-
// RUN: %{xctest_checker} -p "// CHECK-ALL: " %T/all %s
5+
// RUN: %{xctest_checker} -p "// CHECK-METHOD:" %T/one_test_method %s
6+
// RUN: %{xctest_checker} -p "// CHECK-TESTCASE:" %T/one_test_case %s
7+
// RUN: %{xctest_checker} -p "// CHECK-ALL:" %T/all %s
88

99
#if os(Linux) || os(FreeBSD)
1010
import XCTest
@@ -44,11 +44,11 @@ class SkippedTestCase: XCTestCase {
4444
return [("test_baz", test_baz)]
4545
}
4646

47-
// CHECK-ALL: Test Case 'SkippedTestCase.test_baz' started.
48-
// CHECK-ALL: Test Case 'SkippedTestCase.test_baz' passed \(\d+\.\d+ seconds\).
47+
// CHECK-ALL: Test Case 'SkippedTestCase.test_baz' started.
48+
// CHECK-ALL: Test Case 'SkippedTestCase.test_baz' passed \(\d+\.\d+ seconds\).
4949
func test_baz() {}
5050
}
51-
// CHECK-ALL: Executed 1 test, with 0 failures \(0 unexpected\) in \d+\.\d+ \(\d+\.\d+\) seconds
51+
// CHECK-ALL: Executed 1 test, with 0 failures \(0 unexpected\) in \d+\.\d+ \(\d+\.\d+\) seconds
5252

5353
XCTMain([
5454
testCase(ExecutedTestCase.allTests),

Tests/Functional/SingleFailingTestCase/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class SingleFailingTestCase: XCTestCase {
1616
}
1717

1818
// CHECK: Test Case 'SingleFailingTestCase.test_fails' started.
19-
// CHECK: .*/SingleFailingTestCase/main.swift:22: error: SingleFailingTestCase.test_fails : XCTAssertTrue failed -
19+
// CHECK: .*/SingleFailingTestCase/main.swift:22: error: SingleFailingTestCase.test_fails : XCTAssertTrue failed -
2020
// CHECK: Test Case 'SingleFailingTestCase.test_fails' failed \(\d+\.\d+ seconds\).
2121
func test_fails() {
2222
XCTAssert(false)

0 commit comments

Comments
 (0)