Search code examples
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/