|
1 | 1 | #if canImport(Testing) |
2 | | -import IssueReporting |
3 | | -import Testing |
| 2 | + import IssueReporting |
| 3 | + import Testing |
4 | 4 |
|
5 | | -#if DEBUG |
6 | | -@Suite |
7 | | -struct SwiftTestingTests_Debug { |
8 | | - @Test func context() { |
9 | | - #expect(TestContext.current == .swiftTesting) |
10 | | - } |
| 5 | + #if DEBUG |
| 6 | + @Suite |
| 7 | + struct SwiftTestingTests_Debug { |
| 8 | + @Test func context() { |
| 9 | + #expect(TestContext.current == .swiftTesting) |
| 10 | + } |
11 | 11 |
|
12 | | - @Test func reportIssue_NoMessage() { |
13 | | - withKnownIssue { |
14 | | - reportIssue() |
15 | | - } matching: { issue in |
16 | | - issue.description == "Expectation failed: " |
17 | | - } |
18 | | - } |
| 12 | + @Test func reportIssue_NoMessage() { |
| 13 | + withKnownIssue { |
| 14 | + reportIssue() |
| 15 | + } matching: { issue in |
| 16 | + issue.description == "Expectation failed: " |
| 17 | + } |
| 18 | + } |
19 | 19 |
|
20 | | - @Test func reportIssue_CustomMessage() { |
21 | | - withKnownIssue { |
22 | | - reportIssue("Something went wrong") |
23 | | - } matching: { issue in |
24 | | - issue.description == "Expectation failed: Something went wrong" |
25 | | - } |
26 | | - } |
| 20 | + @Test func reportIssue_CustomMessage() { |
| 21 | + withKnownIssue { |
| 22 | + reportIssue("Something went wrong") |
| 23 | + } matching: { issue in |
| 24 | + issue.description == "Expectation failed: Something went wrong" |
| 25 | + } |
| 26 | + } |
27 | 27 |
|
28 | | - @Test func withExpectedIssue_reportIssue() { |
29 | | - withExpectedIssue { |
30 | | - reportIssue() |
31 | | - } |
32 | | - } |
| 28 | + @Test func withExpectedIssue_reportIssue() { |
| 29 | + withExpectedIssue { |
| 30 | + reportIssue() |
| 31 | + } |
| 32 | + } |
33 | 33 |
|
34 | | - @Test func withExpectedIssue_issueRecord() { |
35 | | - withExpectedIssue { |
36 | | - Issue.record() |
37 | | - } |
38 | | - } |
| 34 | + @Test func withExpectedIssue_issueRecord() { |
| 35 | + withExpectedIssue { |
| 36 | + Issue.record() |
| 37 | + } |
| 38 | + } |
39 | 39 |
|
40 | | - @Test func withExpectedIssue_throw() { |
41 | | - withExpectedIssue { throw Failure() } |
42 | | - } |
| 40 | + @Test func withExpectedIssue_throw() { |
| 41 | + withExpectedIssue { throw Failure() } |
| 42 | + } |
43 | 43 |
|
44 | | - @Test func withExpectedIssue_NoMessage_NoIssue() { |
45 | | - withKnownIssue { |
46 | | - withExpectedIssue { |
| 44 | + @Test func withExpectedIssue_NoMessage_NoIssue() { |
| 45 | + withKnownIssue { |
| 46 | + withExpectedIssue { |
| 47 | + } |
| 48 | + } matching: { issue in |
| 49 | + issue.description == "Known issue was not recorded" |
| 50 | + } |
47 | 51 | } |
48 | | - } matching: { issue in |
49 | | - issue.description == "Known issue was not recorded" |
50 | | - } |
51 | | - } |
52 | 52 |
|
53 | | - @Test func withExpectedIssue_CustomMessage_NoIssue() { |
54 | | - withKnownIssue { |
55 | | - withExpectedIssue("This didn't fail") { |
| 53 | + @Test func withExpectedIssue_CustomMessage_NoIssue() { |
| 54 | + withKnownIssue { |
| 55 | + withExpectedIssue("This didn't fail") { |
| 56 | + } |
| 57 | + } matching: { issue in |
| 58 | + issue.description == "Known issue was not recorded: This didn't fail" |
| 59 | + } |
56 | 60 | } |
57 | | - } matching: { issue in |
58 | | - issue.description == "Known issue was not recorded: This didn't fail" |
59 | | - } |
60 | | - } |
61 | 61 |
|
62 | | - @Test func withExpectedIssue_IsIntermittent() async throws { |
63 | | - withExpectedIssue(isIntermittent: true) { |
| 62 | + @Test func withExpectedIssue_IsIntermittent() async throws { |
| 63 | + withExpectedIssue(isIntermittent: true) { |
| 64 | + } |
| 65 | + } |
64 | 66 | } |
65 | | - } |
66 | | -} |
67 | | -#else |
68 | | -@Suite |
69 | | -struct SwiftTestingTests_Release { |
70 | | - @Test func context() { |
71 | | - #expect(TestContext.current == .xcTest) |
72 | | - } |
| 67 | + #else |
| 68 | + @Suite |
| 69 | + struct SwiftTestingTests_Release { |
| 70 | + @Test func context() { |
| 71 | + #expect(TestContext.current == .xcTest) |
| 72 | + } |
73 | 73 |
|
74 | | - @Test func reportIssueDoesNotFail() { |
75 | | - reportIssue() |
76 | | - } |
| 74 | + @Test func reportIssueDoesNotFail() { |
| 75 | + reportIssue() |
| 76 | + } |
77 | 77 |
|
78 | | - @Test func withExpectedIssueDoesNotFail() { |
79 | | - withExpectedIssue {} |
80 | | - } |
81 | | -} |
82 | | -#endif |
| 78 | + @Test func withExpectedIssueDoesNotFail() { |
| 79 | + withExpectedIssue {} |
| 80 | + } |
| 81 | + } |
| 82 | + #endif |
83 | 83 |
|
84 | 84 | #endif |
85 | 85 |
|
|
0 commit comments