tests/testthat/test_coerce.R

test_that("asInteger works", {
    expect_true(is.integer(asInteger(2.3)))
    expect_error(asInteger("a"))
    myvar <- "2"
    expect_error(asInteger(myvar), "Argument myvar should be")
})
rformassspectrometry/MsCoreUtils documentation built on Oct. 24, 2024, 1:52 p.m.