From b60e1a1913355df5d4889b2a21e7dd1eea093e7d Mon Sep 17 00:00:00 2001 From: Kai Aragaki Date: Sat, 4 Nov 2023 15:54:57 -0400 Subject: [PATCH] test: add test for fit consistency --- tests/testthat/test-qp_fit.R | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/testthat/test-qp_fit.R b/tests/testthat/test-qp_fit.R index 3a191cc..cc710cc 100644 --- a/tests/testthat/test-qp_fit.R +++ b/tests/testthat/test-qp_fit.R @@ -17,3 +17,15 @@ test_that(".is_outlier is produced if not present", { expect_message(qp_fit(x), "Did not find column `\\.is_outlier`") expect_true(all(is.na(qp_fit(x)$qp$.is_outlier))) }) + +test_that("fit is consistent", { + suppressMessages( + suppressWarnings( + fit <- absorbances[1:40, ] |> + qp_add_std_conc() |> + qp_fit() + ) + ) + coefs <- round(fit$fit$coefficients, 2) + expect_true(all(coefs == c(2.38, 0.86))) +})