13 lines
357 B
R
13 lines
357 B
R
source("../example.R", chdir=TRUE)
|
|
library(testthat)
|
|
|
|
test_that("Real numbers are transformed to odd numbers.", {
|
|
expect_equal(linear_transformation(3) %% 2, 1)
|
|
expect_equal(linear_transformation(4) %% 2, 1)
|
|
})
|
|
|
|
test_that("Positive numbers remain positive.", {
|
|
expect_true(linear_transformation(3) > 0)
|
|
expect_true(linear_transformation(10) > 0)
|
|
})
|