Description Usage Arguments Details
These operators are powered by the package *doubt* and make testing very compact. * '?~' is 'testthat::expect_true()' * '?e~' is 'testthat::expect_equal()' * '?i~' is 'testthat::expect_identical' These operators have various intteresting properties * They support the unary notation, which allows us to write '?~ is.numeric(2)' * They support infix notation AND left hand side n-ary notation so that you choose between 'tan(pi/4) ?e~ 1', or, '?e~ tan(pi/4) ? 1' * They have the lowest precedence, which means for instance that '2 ?i~ 1 + 1' doesn't need brackets.
This is an infix version of 'testthat::test_that()', compact and handy to highlight the description and spare brackets.
1 2 3 4 5 6 7 8 9 |
object |
Computation and value to compare it to. Both arguments supports limited unquoting to make it easier to generate readable failures within a function or for loop. See quasi_label for more details. |
info |
Extra information to be included in the message. This argument is soft-deprecated and should not be used in new code. Instead see alternatives in quasi_label. |
label |
Used to customise failure messages. For expert use only. |
expected |
Computation and value to compare it to. Both arguments supports limited unquoting to make it easier to generate readable failures within a function or for loop. See quasi_label for more details. |
... |
For |
expected.label |
Used to customise failure messages. For expert use only. |
rather than 'TRUE ?e~ is.numeric(2)'.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.