Skip to content

test: make the StdlibUnittest.Common pass on Windows #25332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions validation-test/StdlibUnittest/Common.swift
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ TestSuiteWithSetUp.test("passes") {

// CHECK: [ RUN ] TestSuiteWithSetUp.fails
// CHECK: stdout>>> setUp
// CHECK-NEXT: stdout>>> check failed at {{.*}}/StdlibUnittest/Common.swift, line
// CHECK-NEXT: stdout>>> check failed at {{.*}}{{[/\\]}}StdlibUnittest{{[/\\]}}Common.swift, line
// CHECK: stdout>>> test body
// CHECK: [ FAIL ] TestSuiteWithSetUp.fails
TestSuiteWithSetUp.test("fails") {
Expand All @@ -366,7 +366,7 @@ TestSuiteWithSetUp.test("fails") {
// CHECK: [ OK ] TestSuiteWithSetUp.passesFails/parameterized/0
// CHECK: [ RUN ] TestSuiteWithSetUp.passesFails/parameterized/1
// CHECK: stdout>>> setUp
// CHECK-NEXT: stdout>>> check failed at {{.*}}/StdlibUnittest/Common.swift, line
// CHECK-NEXT: stdout>>> check failed at {{.*}}{{[/\\]}}StdlibUnittest{{[/\\]}}Common.swift, line
// CHECK: stdout>>> test body
// CHECK: [ FAIL ] TestSuiteWithSetUp.passesFails/parameterized/1
TestSuiteWithSetUp.test("passesFails/parameterized")
Expand Down Expand Up @@ -398,7 +398,7 @@ TestSuiteWithTearDown.test("passes") {
// CHECK: [ RUN ] TestSuiteWithTearDown.fails
// CHECK: stdout>>> test body
// CHECK: stdout>>> tearDown
// CHECK-NEXT: stdout>>> check failed at {{.*}}/StdlibUnittest/Common.swift, line
// CHECK-NEXT: stdout>>> check failed at {{.*}}{{[/\\]}}StdlibUnittest{{[/\\]}}Common.swift, line
// CHECK: [ FAIL ] TestSuiteWithTearDown.fails
TestSuiteWithTearDown.test("fails") {
print("test body")
Expand All @@ -412,7 +412,7 @@ TestSuiteWithTearDown.test("fails") {
// CHECK: [ RUN ] TestSuiteWithTearDown.passesFails/parameterized/1
// CHECK: stdout>>> test body
// CHECK: stdout>>> tearDown
// CHECK-NEXT: stdout>>> check failed at {{.*}}/StdlibUnittest/Common.swift, line
// CHECK-NEXT: stdout>>> check failed at {{.*}}{{[/\\]}}StdlibUnittest{{[/\\]}}Common.swift, line
// CHECK: [ FAIL ] TestSuiteWithTearDown.passesFails/parameterized/1
TestSuiteWithTearDown.test("passesFails/parameterized")
.forEach(in: [1010, 2020]) {
Expand All @@ -437,7 +437,7 @@ AssertionsTestSuite.test("expectFailure/Pass") {
}
}
// CHECK: [ RUN ] Assertions.expectFailure/Pass
// CHECK-NEXT: stdout>>> check failed at {{.*}}/StdlibUnittest/Common.swift, line
// CHECK-NEXT: stdout>>> check failed at {{.*}}{{[/\\]}}StdlibUnittest{{[/\\]}}Common.swift, line
// CHECK: stdout>>> expected: 1 (of type Swift.Int)
// CHECK: stdout>>> actual: 2 (of type Swift.Int)
// CHECK: [ OK ] Assertions.expectFailure/Pass
Expand All @@ -451,7 +451,7 @@ AssertionsTestSuite.test("expectFailure/UXPass")
}
}
// CHECK: [ RUN ] Assertions.expectFailure/UXPass ({{X}}FAIL: [Custom(reason: test)])
// CHECK-NEXT: stdout>>> check failed at {{.*}}/StdlibUnittest/Common.swift, line
// CHECK-NEXT: stdout>>> check failed at {{.*}}{{[/\\]}}StdlibUnittest{{[/\\]}}Common.swift, line
// CHECK: stdout>>> expected: 1 (of type Swift.Int)
// CHECK: stdout>>> actual: 2 (of type Swift.Int)
// CHECK: [ UXPASS ] Assertions.expectFailure/UXPass
Expand All @@ -462,7 +462,7 @@ AssertionsTestSuite.test("expectFailure/Fail") {
}
}
// CHECK: [ RUN ] Assertions.expectFailure/Fail
// CHECK-NEXT: stdout>>> check failed at {{.*}}/StdlibUnittest/Common.swift, line
// CHECK-NEXT: stdout>>> check failed at {{.*}}{{[/\\]}}StdlibUnittest{{[/\\]}}Common.swift, line
// CHECK: stdout>>> expected: true
// CHECK: stdout>>> running `body` should produce an expected failure
// CHECK: [ FAIL ] Assertions.expectFailure/Fail
Expand All @@ -475,7 +475,7 @@ AssertionsTestSuite.test("expectFailure/XFail")
}
}
// CHECK: [ RUN ] Assertions.expectFailure/XFail ({{X}}FAIL: [Custom(reason: test)])
// CHECK-NEXT: stdout>>> check failed at {{.*}}/StdlibUnittest/Common.swift, line
// CHECK-NEXT: stdout>>> check failed at {{.*}}{{[/\\]}}StdlibUnittest{{[/\\]}}Common.swift, line
// CHECK: stdout>>> expected: true
// CHECK: stdout>>> running `body` should produce an expected failure
// CHECK: [ XFAIL ] Assertions.expectFailure/XFail
Expand All @@ -488,10 +488,10 @@ AssertionsTestSuite.test("expectFailure/AfterFailure/Fail") {
}
}
// CHECK: [ RUN ] Assertions.expectFailure/AfterFailure/Fail
// CHECK-NEXT: stdout>>> check failed at {{.*}}/StdlibUnittest/Common.swift, line
// CHECK-NEXT: stdout>>> check failed at {{.*}}{{[/\\]}}StdlibUnittest{{[/\\]}}Common.swift, line
// CHECK: stdout>>> expected: 1 (of type Swift.Int)
// CHECK: stdout>>> actual: 2 (of type Swift.Int)
// CHECK: stdout>>> check failed at {{.*}}/StdlibUnittest/Common.swift, line
// CHECK: stdout>>> check failed at {{.*}}{{[/\\]}}StdlibUnittest{{[/\\]}}Common.swift, line
// CHECK: stdout>>> expected: 3 (of type Swift.Int)
// CHECK: stdout>>> actual: 4 (of type Swift.Int)
// CHECK: [ FAIL ] Assertions.expectFailure/AfterFailure/Fail
Expand All @@ -506,10 +506,10 @@ AssertionsTestSuite.test("expectFailure/AfterFailure/XFail")
}
}
// CHECK: [ RUN ] Assertions.expectFailure/AfterFailure/XFail ({{X}}FAIL: [Custom(reason: test)])
// CHECK-NEXT: stdout>>> check failed at {{.*}}/StdlibUnittest/Common.swift, line
// CHECK-NEXT: stdout>>> check failed at {{.*}}{{[/\\]}}StdlibUnittest{{[/\\]}}Common.swift, line
// CHECK: stdout>>> expected: 1 (of type Swift.Int)
// CHECK: stdout>>> actual: 2 (of type Swift.Int)
// CHECK: stdout>>> check failed at {{.*}}/StdlibUnittest/Common.swift, line
// CHECK: stdout>>> check failed at {{.*}}{{[/\\]}}StdlibUnittest{{[/\\]}}Common.swift, line
// CHECK: stdout>>> expected: 3 (of type Swift.Int)
// CHECK: stdout>>> actual: 4 (of type Swift.Int)
// CHECK: [ XFAIL ] Assertions.expectFailure/AfterFailure/XFail
Expand All @@ -518,7 +518,7 @@ AssertionsTestSuite.test("expectUnreachable") {
expectUnreachable()
}
// CHECK: [ RUN ] Assertions.expectUnreachable
// CHECK-NEXT: stdout>>> check failed at {{.*}}/StdlibUnittest/Common.swift, line
// CHECK-NEXT: stdout>>> check failed at {{.*}}{{[/\\]}}StdlibUnittest{{[/\\]}}Common.swift, line
// CHECK: stdout>>> this code should not be executed
// CHECK: [ FAIL ] Assertions.expectUnreachable

Expand Down Expand Up @@ -582,7 +582,8 @@ AssertionsTestSuite.test("expectTrapping(_: Bound, in: RangeProtocol)") {
expectTrapping(0, in: 1..<10)
}
// CHECK: [ RUN ] Assertions.expectTrapping(_: Bound, in: RangeProtocol)
// CHECK-NEXT: stdout>>> check failed at {{.*}}.swift, line [[@LINE-3]]
// stderr>>> CRASHED: SIGABRT
// CHECK: stdout>>> check failed at {{.*}}.swift, line [[@LINE-4]]
// CHECK: stdout>>> 0 in 1..<10{{$}}
// CHECK: the test crashed unexpectedly
// CHECK: [ FAIL ] Assertions.expectTrapping(_: Bound, in: RangeProtocol)
Expand All @@ -591,7 +592,8 @@ AssertionsTestSuite.test("expectTrapping(_: RangeProtocol, in: RangeProtocol)")
expectTrapping(0..<5, in: 1..<10)
}
// CHECK: [ RUN ] Assertions.expectTrapping(_: RangeProtocol, in: RangeProtocol)
// CHECK-NEXT: stdout>>> check failed at {{.*}}.swift, line [[@LINE-3]]
// stderr>>> CRASHED: SIGABRT
// CHECK: stdout>>> check failed at {{.*}}.swift, line [[@LINE-4]]
// CHECK: stdout>>> 0..<5 in 1..<10{{$}}
// CHECK: the test crashed unexpectedly
// CHECK: [ FAIL ] Assertions.expectTrapping(_: RangeProtocol, in: RangeProtocol)
Expand Down