tests/testthat/test-lc50.R

example_csv <- system.file("extdata", "lc50_example.csv", package = "insectecol")

test_that("lc50_analyze() 的 plot_file 参数导出 png", {
  f <- tempfile(fileext = ".png")
  out <- suppressMessages(lc50_analyze(lc50_read(example_csv),
                                       method = "probit",
                                       plot = TRUE, plot_file = f))
  expect_true(file.exists(f))
  expect_true(file.size(f) > 0)
  expect_equal(unname(out$plot_file), f)
})

Try the insectecol package in your browser

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

insectecol documentation built on Oct. 5, 2026, 5:08 p.m.