tests/testthat/test-remove_spectra_logical.R

# WARNING - Generated by {fusen} from dev/flat_utils.Rmd: do not edit by hand

half_empty <- c(
  MALDIquant::createMassSpectrum(1:3, c(0,0,0)),
  MALDIquant::createMassSpectrum(11:13, 11:13)
)
test_that("remove_spectra_logical works", {
  expect_length(
    remove_spectra_logical(half_empty, check_spectra(half_empty)),
    1
  )
  expect_length(
    remove_spectra_logical(half_empty, to_remove = c(TRUE, FALSE)),
    1
  )
})
test_that("remove_spectra_logical fails with wrong input", {
  expect_error(
    remove_spectra_logical(half_empty, to_remove = "please_remove"),
    "Non logical values"
  )
  expect_error(
    remove_spectra_logical(half_empty, to_remove = TRUE),
    "Unequal lengths"
  )
})

Try the maldipickr package in your browser

Any scripts or data that you put into this service are public.

maldipickr documentation built on Sept. 13, 2024, 1:12 a.m.