Skip to content

Migrate remaining unit tests to Swift Testing - #955

Open
bkhouri wants to merge 1 commit into
bkhouri/t/main/migrate_tests_to_swift_testing_batch6from
bkhouri/t/main/migrate_tests_to_swift_testing_batch7
Open

Migrate remaining unit tests to Swift Testing#955
bkhouri wants to merge 1 commit into
bkhouri/t/main/migrate_tests_to_swift_testing_batch6from
bkhouri/t/main/migrate_tests_to_swift_testing_batch7

Conversation

@bkhouri

@bkhouri bkhouri commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Migrate three ArgumentParserUnitTests suites from XCTest to Swift
Testing:

  • HelpGenerationTests — the base file was already using @Suite,
    @Test, and #expect; drop the stale import XCTest. The
    +*.swift extension files were migrated in earlier PRs.
  • ParsableArgumentsValidationTests — the largest unit-test file.
    One assertion required an update: comparing error.type (an
    existential any ParsableArguments.Type) against a concrete type
    fails to type-check under #expect's stricter operand resolution,
    so wrap both sides in ObjectIdentifier.
  • CompletionScriptTests — marked @Suite(.serialized) because the
    tests share the CompletionShell.requesting global while
    generating completion scripts. Under XCTest the sequential runner
    hid this; Swift Testing's default parallelism caused cross-shell
    contamination in the generated scripts. Private
    assertCustomCompletion(s) ported to
    expectCustomCompletion(s).

Relates to #710

Checklist

  • I've added at least one test that validates that my change is working, if appropriate
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

Stack created with GitHub Stacks CLIGive Feedback 💬

@bkhouri
bkhouri force-pushed the bkhouri/t/main/migrate_tests_to_swift_testing_batch7 branch from e5d13a3 to d21f57a Compare August 25, 2026 03:26
@bkhouri
bkhouri force-pushed the bkhouri/t/main/migrate_tests_to_swift_testing_batch7 branch from d21f57a to 158ad21 Compare August 25, 2026 03:34
@bkhouri
bkhouri marked this pull request as ready for review August 25, 2026 03:37
@bkhouri
bkhouri force-pushed the bkhouri/t/main/migrate_tests_to_swift_testing_batch7 branch 2 times, most recently from 114fdb8 to f646e96 Compare August 25, 2026 03:56
@bkhouri
bkhouri force-pushed the bkhouri/t/main/migrate_tests_to_swift_testing_batch7 branch from f646e96 to b303158 Compare August 25, 2026 04:01
@bkhouri
bkhouri force-pushed the bkhouri/t/main/migrate_tests_to_swift_testing_batch7 branch 2 times, most recently from 28a844f to 6220084 Compare August 26, 2026 06:37
@bkhouri
bkhouri force-pushed the bkhouri/t/main/migrate_tests_to_swift_testing_batch7 branch 2 times, most recently from 6c0fad1 to fcbe973 Compare August 26, 2026 07:49
@bkhouri
bkhouri force-pushed the bkhouri/t/main/migrate_tests_to_swift_testing_batch7 branch from fcbe973 to af7c768 Compare August 26, 2026 07:54
@bkhouri
bkhouri force-pushed the bkhouri/t/main/migrate_tests_to_swift_testing_batch7 branch 2 times, most recently from 1faeafe to 2977e87 Compare August 26, 2026 19:55
@bkhouri
bkhouri force-pushed the bkhouri/t/main/migrate_tests_to_swift_testing_batch7 branch from 2977e87 to dc31f44 Compare August 26, 2026 23:18
@bkhouri
bkhouri force-pushed the bkhouri/t/main/migrate_tests_to_swift_testing_batch7 branch 2 times, most recently from 125a5eb to a2ebda3 Compare August 27, 2026 15:43
Migrate three `ArgumentParserUnitTests` suites from XCTest to Swift
Testing:

- `HelpGenerationTests` — the base file was already using `@Suite`,
  `@Test`, and `#expect`; drop the stale `import XCTest`. The
  `+*.swift` extension files were migrated in earlier PRs.
- `ParsableArgumentsValidationTests` — the largest unit-test file.
  One assertion required an update: comparing `error.type` (an
  existential `any ParsableArguments.Type`) against a concrete type
  fails to type-check under `#expect`'s stricter operand resolution,
  so wrap both sides in `ObjectIdentifier`.
- `CompletionScriptTests` — marked `@Suite(.serialized)` because the
  tests share the `CompletionShell.requesting` global while
  generating completion scripts. Under XCTest the sequential runner
  hid this; Swift Testing's default parallelism caused cross-shell
  contamination in the generated scripts. Private
  `assertCustomCompletion(s)` ported to
  `expectCustomCompletion(s)`.

Relates to #710
@bkhouri
bkhouri force-pushed the bkhouri/t/main/migrate_tests_to_swift_testing_batch7 branch from a2ebda3 to 73ab4d1 Compare August 27, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant