inst/tinytest/test_op2M.R

op2M <- hutilscpp:::op2M
M2op <- hutilscpp:::M2op
Cop2M <- hutilscpp:::Cop2M
operators <- c("!=", "==", ">=", "<=", ">", "<", "%in%", "%between%", "%(between)%",
               "%]between[%", "%notin%")
expect_equal(operators, M2op(seq_along(operators)))

expect_equal(sapply(operators, op2M), sapply(operators, Cop2M))
expect_equal(op2M("foo"), 0L)
expect_equal(Cop2M("foo"), 0L)
expect_equal(Cop2M(""), 0L)
expect_equal(op2M(""), 0L)
expect_true(Cop2M("%notin%") > 0)

Try the hutilscpp package in your browser

Any scripts or data that you put into this service are public.

hutilscpp documentation built on Oct. 11, 2023, 9:06 a.m.