Added example snippets of the presentation.
This commit is contained in:
12
example/test/test_linear_transformation.R
Normal file
12
example/test/test_linear_transformation.R
Normal file
@@ -0,0 +1,12 @@
|
||||
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)
|
||||
})
|
Reference in New Issue
Block a user