【发布时间】:2017-03-12 21:54:37
【问题描述】:
我正在使用 Hspec 和 Quickcheck http://hspec.github.io/ 运行测试
提供的执行随机测试用例的示例是
it "returns the first element of an *arbitrary* list" $
property $ \x xs -> head (x:xs) == (x :: Int)
有关联的输出:
returns the first element of an *arbitrary* list
如何查看为测试生成的实际运行时值?因此,在上面的示例中,示例所需的输出将包括为 x 和 xs 传递的值,例如:
returns the first element of an *arbitrary* list
\x xy head (x:xs) == (x :: Int) with x = 'a' and xs = "bc" holds
【问题讨论】:
-
您可以使用 debug.trace 作为快速而肮脏的解决方案
-
您能否详细解释一下您为什么打算这样做?
标签: haskell random quickcheck hspec