Skip to content

Commit

Permalink
add wh tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wincowgerDEV committed Jan 26, 2024
1 parent 3553ebc commit fd3b06a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/testthat/test-smooth_intens.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ test_that("smooth_intens() works as expected", {
smooth_intens(raman_hdpe, polynomial = 1)$spectra$intensity) |>
round(4) |>
expect_equal(0.8043, ignore_attr = F)

smt2 <- smooth_intens(raman_hdpe, lambda = 1600, d = 2, lag = 2, type = "wh") |> expect_silent()

cor(smt2$spectra$intensity,smooth_intens(raman_hdpe, lambda = 100, d = 2, lag = 2, type = "wh")$spectra$intensity) |>
round(4) |>
expect_equal(0.8572, ignore_attr = F)

expect_true(check_OpenSpecy(smt2))
expect_true(check_OpenSpecy(smt))
expect_s3_class(smt, "OpenSpecy")
expect_equal(nrow(smt$spectra), nrow(raman_hdpe$spectra))
expect_equal(smt$wavenumber, raman_hdpe$wavenumber)
Expand Down

0 comments on commit fd3b06a

Please sign in to comment.