New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot filter/select tests with commas in their name #417
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I noticed that I am unable to select and run a single test if it contains a comma in its name. XCTest doesn't find the test and it runs 0 tests instead of the one I selected.
The issue comes from this line: https://github.com/apple/swift-corelibs-xctest/blob/release/5.7/Sources/XCTest/Private/ArgumentParser.swift#L69
As you can see it expects tests names to be separated by a comma in the CLI invocation. This breaks tests that contain a comma in their name, as it will split the properly formed test name into multiple non existent tests.
This is a problem when using Quick that creates test names following the pattern
test subject, given that, when I do this, it does that
.As you can imagine when running
swift test --filter "test subject, given that, when I do this, it does that"
(or the testing.xctest
binary directly) it tries to run 4 tests:test subject
,given that
,when I do this
,it does that
and ends up doing nothing.I made a minimal project that reproduces this issue: https://github.com/natinusala/xctest-comma
I would expect the last command to run 1 test instead if 0.
This is on Linux. While I don't have a Mac computer with me to try, I do believe the macOS version of XCTest does not have this issue (since Quick has been around for some time on Xcode and it seems to work there from what I've gathered).
The text was updated successfully, but these errors were encountered: