tests/coverage-Inf/test-fonction_random.R

moy <- function(x, y) {
    return((x + y) / 2)
}


test_that("moy works", {
    expect_identical(moy(2, 2), 2)
    expect_identical(moy(2, 0), 1)
})



test_that("moy doesn't work", {
    expect_error(moy("a", 2))
    expect_error(moy(2))
    expect_error(moy(2, "2"))
})

Try the TractorTsbox package in your browser

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

TractorTsbox documentation built on April 4, 2025, 4:11 a.m.