如何在testthat中构成期望?

时间:2017-07-06 17:47:33

标签: r testthat

从现有期望中编写自定义期望的天真方法是:

expect_failure

但这不适用于expect_failure,因为expect_between(0.5, 0, 1) # PASSES expect_between(-99, 0, 1) # FAILS expect_between(99, 0, 1) # FAILS expect_failure(expect_between(-99, 0, 1)) # PASSES expect_failure(expect_between(99, 0, 1)) # FAILS <--- the problem 会抓住第一个期望。

expect_failure

在编写用户定义的期望时,构建期望的正确方法是什么,以便它们仍能与Group一起使用?

0 个答案:

没有答案