-
Notifications
You must be signed in to change notification settings - Fork 589
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix assertSnapshot for Swift Testing tests. (#916)
* Fix assertSnapshot for Swift Testing tests. * wip * Update CI
- Loading branch information
Showing
12 changed files
with
75 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#if compiler(>=6) && canImport(Testing) | ||
import Testing | ||
import SnapshotTesting | ||
|
||
@Suite(.snapshots(diffTool: "ksdiff")) | ||
struct SwiftTestingTests { | ||
@Test func testSnapshot() { | ||
assertSnapshot(of: ["Hello", "World"], as: .dump) | ||
} | ||
|
||
@Test func testSnapshotFailure() { | ||
withKnownIssue { | ||
assertSnapshot(of: ["Goodbye", "World"], as: .dump) | ||
} matching: { issue in | ||
issue.description.hasSuffix(""" | ||
@@ −1,4 +1,4 @@ | ||
▿ 2 elements | ||
− - "Hello" | ||
+ - "Goodbye" | ||
- "World" | ||
""") | ||
} | ||
} | ||
} | ||
#endif |
3 changes: 3 additions & 0 deletions
3
Tests/SnapshotTestingTests/__Snapshots__/SwiftTestingTests/testSnapshot.1.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
▿ 2 elements | ||
- "Hello" | ||
- "World" |
3 changes: 3 additions & 0 deletions
3
Tests/SnapshotTestingTests/__Snapshots__/SwiftTestingTests/testSnapshotFailure.1.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
▿ 2 elements | ||
- "Hello" | ||
- "World" |