diff --git a/DESCRIPTION b/DESCRIPTION index 79ddb3f..f1210b2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -12,6 +12,8 @@ License: MIT + file LICENSE Encoding: UTF-8 LazyData: true RoxygenNote: 6.0.1 -Suggests: covr +Suggests: + covr, + testthat (>= 2.0.0) Imports: dplyr (>= 0.7.6) diff --git a/tests/testthat.R b/tests/testthat.R new file mode 100644 index 0000000..d80c467 --- /dev/null +++ b/tests/testthat.R @@ -0,0 +1,4 @@ +library(testthat) +library(maRgheRitaR) + +test_check("maRgheRitaR") diff --git a/tests/testthat/test-center.R b/tests/testthat/test-center.R new file mode 100644 index 0000000..d7d94fd --- /dev/null +++ b/tests/testthat/test-center.R @@ -0,0 +1,5 @@ +context("test-center.R") + +test_that("centering works", { + expect_equal(center(c(1,2,3),0), c(-1,0,1)) +}) diff --git a/tests/testthat/test-rescale.R b/tests/testthat/test-rescale.R new file mode 100644 index 0000000..6310a4d --- /dev/null +++ b/tests/testthat/test-rescale.R @@ -0,0 +1,5 @@ +context("test-rescale.R") + +test_that("rescaling works", { + expect_equal(rescale(1:5), 0.25*(0:4)) +})