Skip to content

Commit

Permalink
ignore some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wincowgerDEV committed Sep 2, 2023
1 parent 303c2f6 commit 86f9445
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 4 additions & 0 deletions tests/testthat/test-def_features.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ test_that("check that particles are identified with all TRUE or FALSE logical ve
})

test_that("the original spectrum remains unmodified and metadata is amended", {
skip_on_cran()

map <- read_extdata("CA_tiny_map.zip") |> read_any()

id_map <- def_features(map,ifelse(map$metadata$x == 1,
Expand All @@ -60,6 +62,8 @@ test_that("the original spectrum remains unmodified and metadata is amended", {
})

test_that("collapse particles returns expected values", {
skip_on_cran()

particles <- ifelse(map$metadata$y == 1, "particleA", "particleB")
id_map <- def_features(map, particles)
expect_true(check_OpenSpecy(id_map))
Expand Down
13 changes: 6 additions & 7 deletions tests/testthat/test-match_spec.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ preproc <- conform_spec(unknown, range = test_lib$wavenumber,
res = spec_res(test_lib)) |>
process_spec(smooth_intens = T, make_rel = T)

# Create a subset of test_lib for filtering
test_lib_extract <- filter_spec(
test_lib, logic = test_lib$metadata$polymer_class == "polycarbonates"
)

test_that("ai_classify() handles input errors correctly", {
ai_classify(1:1000) |> expect_error()
})
Expand Down Expand Up @@ -45,6 +40,8 @@ test_that("match_spec() handles input errors correctly", {

# Match_spec function
test_that("match_spec() returns correct structure", {
skip_on_cran()

matches <- match_spec(x = preproc, library = test_lib, na.rm = T, top_n = 5,
add_library_metadata = "sample_name",
add_object_metadata = "col_id") |>
Expand Down Expand Up @@ -74,8 +71,10 @@ test_that("cor_spec() handles input errors correctly", {

# Write the tests for cor_spec function
test_that("cor_spec() returns a data.table with correct columns", {
matches <- cor_spec(preproc, library = test_lib) |>
expect_silent()
skip_on_cran()

matches <- cor_spec(preproc, library = test_lib) |>
expect_silent()

preproc2 <- preproc
preproc2$wavenumber[1:3] <- preproc2$wavenumber[1:3] + 1
Expand Down

0 comments on commit 86f9445

Please sign in to comment.