Closed eltix closed 1 month ago
Here is what I copied in our company channel (looks like @eltix and I are working together).
for 2. the filtering logic is implemented as follows:
filterGuard :: DList Text -> Bool
filterGuard dl =
null fs
|| any (\f -> f `T.isInfixOf` T.intercalate "." (DList.toList dl)) fs
Where fs :: [Text]
is the sum of all the items from the -f
, or -m
or --filter
.
So it matchs if ANY of the filtering items (so that's a big "OR") is contained inside the concatenated tree items.
But you are right that space are understood as another item.
HOWEVER, passing without -f
or -m
or --filter
any string does not split on " "
.
So just use nix run .#simwork.jinquantities.unit -- -- 'Data.Quantities.ExprParserSpec.preprocessUnit.handles base'
@NorfairKing I'll open an MR to clarify in the --help
documentation the usage of the different flag and the space
@eltix I've never really paid close attention to how to deal with spaces in test descriptions.
The filter logic needs to be fixed, really, instead of "just" documented. I'm open to a proposal to fix it.
The "or" use-case of being able to specify multiple is also not so important to me because we can "just" put two tests under the same describe and "or" them that way.
P.S. If you ever run into the use-case of running partitions of tests in in separate runs on separate machines, please let me know as well.
I am not sure whether this is a bug or me failing to understand how those flags work. Since
--filter
and--match
seem to be doing the exact same thing, I will use--filter
in the following without loss of generality.Let's say I have a Sydtest test suite that I run with the command
nix run .#test-suite
which runs 49 tests, the following being an excerpt of the console outputIt runs the following tests:
Data.Quantities.ConvertSpec convertBase ✓ converts to base 49.61 ms Data.Quantities.ExprParserSpec preprocessUnit ✓ handles base 49.51 ms ✓ handles prefix 49.56 ms Data.Quantities.DefinitionParserSpec makeDefinitions ✓ makes base definition 0.62 ms
Passed: 4 Failed: 0
Data.Quantities.ExprParserSpec preprocessUnit ✓ handles base 44.97 ms ✓ handles prefix 44.99 ms