Migrate ArgumentParserUnitTests to Swift Testing - #954
Open
bkhouri wants to merge 1 commit into
Open
Conversation
bkhouri
force-pushed
the
bkhouri/t/main/migrate_tests_to_swift_testing_batch6
branch
from
August 25, 2026 03:26
8bcc89d to
0e95990
Compare
bkhouri
force-pushed
the
bkhouri/t/main/migrate_tests_to_swift_testing_batch6
branch
from
August 25, 2026 03:34
0e95990 to
ffa782e
Compare
bkhouri
marked this pull request as ready for review
August 25, 2026 03:37
bkhouri
force-pushed
the
bkhouri/t/main/migrate_tests_to_swift_testing_batch6
branch
from
August 25, 2026 03:54
ffa782e to
5645cbc
Compare
bkhouri
force-pushed
the
bkhouri/t/main/migrate_tests_to_swift_testing_batch6
branch
from
August 25, 2026 03:56
5645cbc to
3287ed3
Compare
bkhouri
force-pushed
the
bkhouri/t/main/migrate_tests_to_swift_testing_batch6
branch
3 times, most recently
from
August 26, 2026 06:37
a57e640 to
40b6272
Compare
bkhouri
force-pushed
the
bkhouri/t/main/migrate_tests_to_swift_testing_batch6
branch
2 times, most recently
from
August 26, 2026 07:49
e870a21 to
07df2f2
Compare
bkhouri
force-pushed
the
bkhouri/t/main/migrate_tests_to_swift_testing_batch6
branch
from
August 26, 2026 07:54
07df2f2 to
ea6a7ce
Compare
| final class DefaultAsFlagCompletionTests: XCTestCase { | ||
| func testDefaultAsFlagCompletion_Bash() throws { | ||
| @Suite struct DefaultAsFlagCompletionTests { | ||
| @Test func testDefaultAsFlagCompletion_Bash() throws { |
Member
There was a problem hiding this comment.
These few functions didn't lose the test prefix – could you check that across the different branches?
bkhouri
force-pushed
the
bkhouri/t/main/migrate_tests_to_swift_testing_batch6
branch
from
August 26, 2026 18:18
ea6a7ce to
b89c539
Compare
bkhouri
force-pushed
the
bkhouri/t/main/migrate_tests_to_swift_testing_batch6
branch
from
August 26, 2026 19:55
b89c539 to
055aa9c
Compare
bkhouri
force-pushed
the
bkhouri/t/main/migrate_tests_to_swift_testing_batch6
branch
from
August 26, 2026 23:18
055aa9c to
9dcb4ef
Compare
bkhouri
force-pushed
the
bkhouri/t/main/migrate_tests_to_swift_testing_batch6
branch
from
August 27, 2026 02:47
9dcb4ef to
39f685a
Compare
bkhouri
force-pushed
the
bkhouri/t/main/migrate_tests_to_swift_testing_batch6
branch
from
August 27, 2026 15:43
39f685a to
11c93bf
Compare
Migrate six `ArgumentParserUnitTests` suites from XCTest to Swift Testing: - `DefaultAsFlagCompletionTests` - `DefaultAsFlagDumpHelpTests` - `DumpHelpGenerationTests` - `ExitCodeTests` - `NameSpecificationTests` - `UsageGenerationTests` Add three new Swift Testing helpers to `TestHelpers+SwiftTesting.swift` to unblock the dump-help and snapshot tests: - `expectDumpHelp(type:)` / `expectDumpHelp(command:)` — Swift Testing equivalents of `assertDumpHelp`, exercising the `--experimental-dump-help` path and comparing against `Snapshots/*.json`. - `expectJSONEqualFromString(actual:expected:for:)` — parses both sides as `T: Codable & Equatable` before `#expect`-ing equality. `NameSpecificationTests` had `Assert`, `Assert(names:expected:)`, and `AssertInvalid` file-private XCTest helpers; port them to `expectNames` / `expectInvalid` using `#expect` with a `SourceLocation` parameter. `UsageGenerationTests` had a `_testSynopsis` free function; port to `expectSynopsis` using `#expect`. `ExitCodeTests` keeps the `NSError`-specific test with all its platform `#if` branches intact, converting each `XCTAssertEqual` to `#expect(a == b)`. Relates to #710
bkhouri
force-pushed
the
bkhouri/t/main/migrate_tests_to_swift_testing_batch6
branch
from
August 27, 2026 17:07
11c93bf to
36b827d
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate six
ArgumentParserUnitTestssuites from XCTest to SwiftTesting:
DefaultAsFlagCompletionTestsDefaultAsFlagDumpHelpTestsDumpHelpGenerationTestsExitCodeTestsNameSpecificationTestsUsageGenerationTestsAdd three new Swift Testing helpers to
TestHelpers+SwiftTesting.swiftto unblock the dump-help and snapshot tests:
expectDumpHelp(type:)/expectDumpHelp(command:)— Swift Testingequivalents of
assertDumpHelp, exercising the--experimental-dump-helppath and comparing againstSnapshots/*.json.expectJSONEqualFromString(actual:expected:for:)— parses both sidesas
T: Codable & Equatablebefore#expect-ing equality.NameSpecificationTestshadAssert,Assert(names:expected:), andAssertInvalidfile-private XCTest helpers; port them toexpectNames/expectInvalidusing#expectwith aSourceLocationparameter.UsageGenerationTestshad a_testSynopsisfree function; port toexpectSynopsisusing#expect.ExitCodeTestskeeps theNSError-specific test with all itsplatform
#ifbranches intact, converting eachXCTAssertEqualto#expect(a == b).Relates to #710
Checklist
Stack created with GitHub Stacks CLI • Give Feedback 💬