如何使用 `--match` 和 cabal 测试特定的 hSpec 属性

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

我有一堆测试模块,我可以 运行 使用 cabal 测试的特定模块。

cabal test Module.Name.Here

该模块包含许多测试,其中一个失败并给出以下消息。

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

如何使用这个匹配字符串?我尝试了各种组合 none,它们都有效。我也看过 cabal test --help 它没有在任何地方提到 --match 标志。

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

非常感谢任何帮助。

运行 像这样:

cabal test —test-options=—match=/Module.Name.Here/hspecDescribeString/hspecPropName/