test_that("no outliers are detected when absent", { x <- SimulateAnomalies(100, 0, 10) Tindex <- FindOutliers(x, "T") expect_equal(length(Tindex), 0) Hindex <- FindOutliers(x, "H") expect_equal(length(Hindex), 0) Bindex <- FindOutliers(x, "B") expect_equal(length(Bindex), 0) }) test_that("one outlier is detected when present", { x <- SimulateAnomalies(100, 1, 10) Tindex <- FindOutliers(x, "T") expect_equal(Tindex, 1) Hindex <- FindOutliers(x, "H") expect_equal(Hindex, 1) Bindex <- FindOutliers(x, "B") expect_equal(Bindex, 1) })