UnkindPartition / tasty

Modern and extensible testing framework for Haskell
640 stars 110 forks source link

Propagate 'forceMatch' for empty test groups #376

Closed martijnbastiaan closed 1 year ago

martijnbastiaan commented 1 year ago

Similar to the logic in goSeqGroup:

https://github.com/UnkindPartition/tasty/blob/804b2a7d8323902ece3f1077c36860929343d9db/core/Test/Tasty/Run.hs#L442-L444

filterByPattern needs to return forceMatch, lest the return value will always be Any False due to (mempty :: Any) ~ Any False for the Parallel branch:

https://github.com/UnkindPartition/tasty/blob/804b2a7d8323902ece3f1077c36860929343d9db/core/Test/Tasty/Core.hs#L568-L572

Note that this only applies to testGroup (i.e. Parallel), but fixing it in that specific branch would create yet another level of nesting in filterByPattern.

An empty test group has been added to the filterTestTree test logic in SequentialTestGroup to prevent regressions.

martijnbastiaan commented 1 year ago

Thank you :)