Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在玩 oUnit2 并且我想知道:该test_ctxt参数是否有任何用法,如下所示:
test_ctxt
let test1 test_ctxt = assert_equal "x" (Foo.unity "x");;
对我来说似乎是多余的。在将测试定义为变量时有什么方法可以省略它?
类型的值test_ctxt被接受为assert_command和assert_equal函数中的可选参数,它们是构建测试的主要基本块。测试上下文特别包含对记录器的引用,允许并行运行测试。使用您的示例,正确的调用将是:
assert_command
assert_equal
let test1 ctxt = assert_equal ~ctxt "x" (Foo.unit "x)