-
-
Save adam-fowler/295f331f3de1f7ab35e6f491966f919b to your computer and use it in GitHub Desktop.
Swift Testing Migration Utilities
This file contains hidden or 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
replace: func test(.*)\(\) | |
with: @Test func test$1() |
This file contains hidden or 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
replace: (try\s+)?XCTAssertEqual\((.*),\s*([^,]+)\) | |
with: #expect($2 == $3) | |
replace: (try\s+)?XCTAssertNotEqual\((.*),\s*([^,]+)\) | |
with: #expect($2 != $3) |
This file contains hidden or 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
replace: XCTAssertNil\((.*)\) | |
with: #expect($1 == nil) | |
replace: XCTAssertNotNil\((.*)\) | |
with: #expect($1 != nil) |
This file contains hidden or 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
replace: XCTAssertNoThrow\((.*)\) | |
with: #expect(throws: Never.self) { $1 } |
This file contains hidden or 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
replace: XCTAssertThrowsError\((.*)\) | |
with: #expect(throws: (any Error).self) { $1 } |
This file contains hidden or 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
replace: XCTFail | |
with: Issue.record |
This file contains hidden or 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
replace: XCTUnwrap\((.*)\) | |
with: #require($1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment