Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hechth committed Oct 30, 2024
1 parent 0ac4b5e commit c20e40b
Show file tree
Hide file tree
Showing 17 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions tests/testthat/test-IsoFiltR.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
update_expected <- function(actual, expected_path) {
saveRDS(actual, file = expected_path)
}

patrick::with_parameters_test_that("IsoFiltR works",
{
raw <- read.csv(file.path("test-data", paste0("QC1_1_", toupper(mode), "_500.csv")))
actual <- IsoFiltR(raw)
expected <- readRDS(file.path("test-data", paste0(mode, "_iso.rds")))
expected_path <- file.path("test-data", paste0(mode, "_iso.rds"))
expected <- readRDS(expected_path)

expect_equal(actual, expected)
},
mode = c("pos", "neg")
Expand All @@ -20,7 +26,6 @@ test_that("IsoFiltR works on recetox-aplcms output", {

patrick::with_parameters_test_that("filtered_data_is_empty works", {
expect_equal(filtered_data_is_empty(test_data), expected)

},
patrick::cases(
empty = list(test_data=list(content=c()), expected=TRUE),
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-MFAssign.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ load_expected <- function(mode) {
))
}

save_expected <- function(actual, mode) {
update_expected <- function(actual, mode) {
paths <- expected_paths(mode)
saveRDS(actual$Unambig, paths$unambig)
saveRDS(actual$Ambig, paths$ambig)
Expand Down
Binary file modified tests/testthat/test-data/21_qc_no_dil_milliq_iso.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/neg_ambig.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/neg_cho_ambig.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/neg_cho_none.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/neg_cho_unambig.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/neg_iso.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/neg_none.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/neg_unambig.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/pos_ambig.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/pos_cho_ambig.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/pos_cho_none.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/pos_cho_unambig.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/pos_iso.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/pos_none.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/pos_unambig.rds
Binary file not shown.

0 comments on commit c20e40b

Please sign in to comment.