Added example snippets of the presentation.

This commit is contained in:
Hylke C. Donker
2022-02-17 11:50:55 +01:00
commit 635b784fba
4 changed files with 47 additions and 0 deletions

View 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)
})