Skip to content

Commit

Permalink
test: added test for comma-separated shimadzu file
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanbass committed Jan 12, 2024
1 parent 0f39809 commit f419fe8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ Config/reticulate: list( packages = list(list(package = "scipy"),
Encoding: UTF-8
Language: en-US
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.0
Additional_repositories: https://ethanbass.github.io/drat/
Config/testthat/edition: 3
19 changes: 18 additions & 1 deletion tests/testthat/test-extra.R
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ test_that("read_chroms can read 'Waters RAW' files", {
expect_equal(dim(x$MS), c(725, 740))
expect_equal(attr(x$MS, "parser"), "rainbow")
expect_equal(attr(x$MS, "data_format"), "wide")
expect_equal(attr(x$MS, "metadata")$polarity,"+")
expect_equal(attr(x$MS, "metadata")$polarity, "+")

x1 <- read_chroms(path, format_in = "waters_raw", progress_bar = FALSE,
parser = "chromconverter")[[1]]
Expand Down Expand Up @@ -323,6 +323,23 @@ test_that("read_chroms can read 'Shimadzu' PDA files (ascii and LCD)", {
expect_equal(x, x2, ignore_attr = TRUE)
})


test_that("read_chroms can read 'Shimadzu' PDA comma-separated file", {
skip_on_cran()
skip_if_not_installed("chromConverterExtraTests")

path_ascii <- system.file("shimadzuDAD_comma.txt",
package = "chromConverterExtraTests")
skip_if_not(file.exists(path_ascii))

x <- read_chroms(path_ascii, format_in = "shimadzu_dad", progress_bar = FALSE)[[1]]
expect_equal(class(x)[1], "matrix")
expect_equal(dim(x), c(6096, 171))
expect_equal(attr(x, "parser"), "chromconverter")
expect_equal(attr(x, "data_format"), "wide")
expect_equal(attr(x, "sample_name"), "Pinoresinol Standard")
})

test_that("read_chroms can read 'Agilent' dx files", {
skip_on_cran()
skip_if_not_installed("chromConverterExtraTests")
Expand Down

0 comments on commit f419fe8

Please sign in to comment.