Currently the permutations methods in Swift-Algorithms cannot be used together with Swift Testing, since the PermutationsSequence does not conform to Collection, which is required by Swift-Testing. It would be very useful to use permutations for arguments in Swift Testing.
Swift Testing currently supports taking two collections and invoking a test function with every combination of their elements. See Test with more than one collection in the documentation.
Do you specifically need permutations or is combinations sufficient?
As a workaround, you can wrap the PermutationsSequence in Array(β¦) to capture the sequence into a collection.
It's necessary for the Swift Testing interface to constrain arguments to Collection because Sequence does not indicate if it is safe to iterate it more than once, and Swift Testing may need to iterate over the arguments more than once in some circumstances.