unit-testinghaskelltestingcabalhspec

How to test specific hSpec property using `--match` and cabal


I have a bunch of test modules and I can run a specific one using cabal test.

cabal test Module.Name.Here

The module contains many tests and one of them fails and it gives the following message.

  To rerun use: --match "/Module.Name.Here/hspecDescribeString/hspecPropName/"

How do I use this match string? I've tried various combinations none of them works ๐Ÿ˜ž. I've also looked at cabal test --help it does not mention --match flag anywhere.

cabal test Module.Name.Here --match rest-of-the-match-string
cabal test Module.Name.Here -- --match rest-of-the-match-string
cabal test match-string
cabal test -- match-string

Any help is much appreciated.


Solution

  • Run it like this:

    cabal test โ€”test-options=โ€”match=/Module.Name.Here/hspecDescribeString/hspecPropName/