phile314 / tasty-silver

A fancy test runner for tasty and support for golden tests.
MIT License
11 stars 3 forks source link

Support for tasty test dependencies (Non-exhaustive pattern match warnings with tasty-1.4.1) #28

Open sjakobi opened 3 years ago

sjakobi commented 3 years ago

I simply noticed these in the build log and wondered whether they would pose a problem:

Test/Tasty/Silver/Filter.hs:114:9: warning: [-Wincomplete-patterns]
    Pattern match(es) are non-exhaustive
    In an equation for ‘filter'’:
        Patterns not matched:
            [] (After _ _ _)
            (_:_) (After _ _ _)
    |
114 |         filter' pth (SingleTest n t) = if prd (pth <//> n) then Just $ SingleTest n t else Nothing
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

Test/Tasty/Silver/Interactive/Run.hs:36:1: warning: [-Wincomplete-patterns]
    Pattern match(es) are non-exhaustive
    In an equation for ‘wrapRunTest'’:
        Patterns not matched:
            [] _ (After _ _ _)
            (_:_) _ (After _ _ _)
   |
36 | wrapRunTest' tp f (SingleTest n t) = SingleTest n (CustomTestExec t (f (tp <//> n) n))
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
phile314 commented 3 years ago

Hm, looks like tasty-silver does not support test dependencies as introduced in https://github.com/UnkindPartition/tasty/commit/6506befcd3bfc274aabeda5f10d36089fd6ff625 / https://github.com/UnkindPartition/tasty/issues/48 . As long as you are not using this tasty feature you should be perfectly fine.

I guess fixing the test filtering might not be so simple, as I guess if a test ends up in the final set of tests to run it should also include all transitive dependencies. I don't think I will get around to fix this in the near future, but if anybody wants to give it a go feel free to open a PR.