Skip to content

Commit

Permalink
test: add test for fit consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiAragaki committed Nov 4, 2023
1 parent e8f90c2 commit b60e1a1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/testthat/test-qp_fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
})

0 comments on commit b60e1a1

Please sign in to comment.