aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat/test_nafta.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2019-02-25 17:05:59 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2019-02-25 17:05:59 +0100
commit241f0b977092e4fe106a23ef70506bf37c1a3609 (patch)
treee7a7dfcbfbb5c9d94f1d69c6aca0f08b44627f11 /tests/testthat/test_nafta.R
parentaeb6ff55560fa1c704312576be82e3e7ab4ab364 (diff)
Fix tests and add plot and print for nafta
Diffstat (limited to 'tests/testthat/test_nafta.R')
-rw-r--r--tests/testthat/test_nafta.R9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/testthat/test_nafta.R b/tests/testthat/test_nafta.R
index 7d650ad8..3615c278 100644
--- a/tests/testthat/test_nafta.R
+++ b/tests/testthat/test_nafta.R
@@ -16,9 +16,6 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>
-library(testthat)
-library(mkin)
-
context("Evaluations according to the NAFTA guidance from 2015")
test_that("Data for more than one compound are rejected",
@@ -31,6 +28,7 @@ test_that("Test data from Appendix D are correctly evaluated", {
dtx_sop <- matrix(c(407, 541, 429, 1352, 5192066, 2383), nrow = 3, ncol = 2)
expect_equivalent(res$distimes[, 1:2], dtx_sop, tolerance = 1,
scale = 1)
+
C0_sop <- c(SFO = 83.8, IORE = 96.9, DFOP = 97.6)
C0_mkin <- sapply(res$parameters, function(x) x["parent_0", "Estimate"])
expect_equivalent(C0_mkin, C0_sop, scale = 1, tolerance = 0.1)
@@ -38,4 +36,9 @@ test_that("Test data from Appendix D are correctly evaluated", {
expect_equal(round(res$S_c), 717)
expect_equal(signif(res$S[["SFO"]], 3), 1.38e+3)
expect_equal(round(res$t_rep), 841)
+
+ expect_known_output(print(res), "print_nafta_analysis.txt")
+
+ plot_nafta <- function() plot(res)
+ vdiffr::expect_doppelganger("Plot NAFTA analysis SOP Appendix D", plot_nafta)
})

Contact - Imprint