aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2022-03-02 08:30:46 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2022-03-02 08:30:46 +0100
commit6468bc31254baeac7dad90a38715714291be30ae (patch)
tree7fa39286d2b56e4bd86152abec493f6dbd8c5576 /tests
parent1ba0938b5a39f9d376b54fe3469b40aafea9e8e3 (diff)
Add a test for tffm0()
Diffstat (limited to 'tests')
-rw-r--r--tests/testthat/test_tffm0.R10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/testthat/test_tffm0.R b/tests/testthat/test_tffm0.R
new file mode 100644
index 00000000..82e1ee94
--- /dev/null
+++ b/tests/testthat/test_tffm0.R
@@ -0,0 +1,10 @@
+test_that("The formation fraction transformation tffm0 is reversible", {
+ ff_example <- c(
+ 0.10983681, 0.09035905, 0.08399383
+ )
+ ff_example_trans <- tffm0(ff_example)
+ expect_equal(invtffm0(ff_example_trans), ff_example)
+
+ ff_ex_2_trans <- c(0.5, 0.9, 0.99)
+ expect_true(sum(invtffm0(ff_ex_2_trans)) < 1)
+})

Contact - Imprint