tests/testthat/test-library_search_r.R

test_that("Search(), compare with snapshot (synthetic mass spectra)", {
  load(test_path("data/library_search/library_search_synthetic.rda"))
  # The file contains two objects: 'input_args' and 'snapshot'
  res <- lapply(input_args, function(a1) { do.call("LibrarySearch", a1)})
  for (i in seq_along(res)) {
    for (j in seq_along(res[[i]])) {
      expect_equal(res[[i]][[j]], snapshot[[i]][[j]])
    }
  }
})

Try the mssearchr package in your browser

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

mssearchr documentation built on April 3, 2025, 8:28 p.m.