I have a parameterized Swift Testing @Test function for which some of the parameters are currently known to fail. To make things more annoying, they fail because of violated assertions/preconditions, which invokes the debugger and prevents running the rest of the tests (in Xcode).
Is there any way to use .disable(if:)
to disable just the test cases that are causing problems? (Ideally, I'd prefer to be able to use withKnownIssue
to just wrap the potential problems, but that functionality seems to not exist (yet).)
Reproduction case:
func functionality(parameter: Int) -> Bool {
precondition(parameter != 1)
return true
}
struct ReproCase {
// How can we mark this test as disabled if parameter is 1?
@Test(arguments: [1, 2])
func test(parameter: Int) {
#expect(functionality(parameter: parameter))
}
}