diff --git a/tests/testthat/test-simplifyArtifactData.R b/tests/testthat/test-simplifyArtifactData.R index 4a570c69..bfd2a4c9 100644 --- a/tests/testthat/test-simplifyArtifactData.R +++ b/tests/testthat/test-simplifyArtifactData.R @@ -142,13 +142,13 @@ test_that("simplifyArtifactData when missing fragment sizes, low/rv/high", { # all fragments are coallated into the unspecified column # totals should be correct - # some horizons have no fragment records, should generate a warning + # some horizons have no fragment records d.missing.size <- d.artifact.hz d.missing.size[,c("huartsize_l", "huartsize_r", "huartsize_h")] <- NA d.missing.size[4,] <- d.missing.size[3,] d.missing.size[4,] <- NA d.missing.size[4,'phiid'] <- "10102" - expect_message(res <- simplifyArtifactData(d.missing.size, id.var = 'phiid', nullFragsAreZero = TRUE)) + expect_silent(res <- simplifyArtifactData(d.missing.size, id.var = 'phiid', nullFragsAreZero = TRUE)) # rows missing fragvol should be removed from the simplified result expect_true(nrow(d.missing.size) == 4) @@ -171,8 +171,7 @@ test_that("simplifyArtifactData warning generated when NA in huartvol", { d.missing.artvol <- d.artifact.hz d.missing.artvol$huartvol <- NA d.missing.artvol[1,'huartvol'] <- 10 - expect_message(simplifyArtifactData(d.missing.artvol, id.var = 'phiid', nullFragsAreZero = TRUE), - regexp = 'some records are missing artifact volume') + expect_silent(simplifyArtifactData(d.missing.artvol, id.var = 'phiid', nullFragsAreZero = TRUE)) }) diff --git a/tests/testthat/test-simplifyFragmentData.R b/tests/testthat/test-simplifyFragmentData.R index b4a6dee5..1197078f 100644 --- a/tests/testthat/test-simplifyFragmentData.R +++ b/tests/testthat/test-simplifyFragmentData.R @@ -450,10 +450,10 @@ test_that("simplifyFragmentData complex sample data from NASIS, single horizon", test_that("simplifyFragmentData when missing fragment sizes, low/rv/high", { - # all fragments are coallated into the unspecified column + # all fragments are collated into the unspecified column # totals should be correct - # some horizons have no fragment records, should generate a warning - expect_message( { res <- simplifyFragmentData(d.missing.size, id.var = 'phiid', nullFragsAreZero = TRUE) } ) + # some horizons have no fragment records + expect_silent( { res <- simplifyFragmentData(d.missing.size, id.var = 'phiid', nullFragsAreZero = TRUE) } ) # rows missing fragvol should be removed from the simplified result expect_true(nrow(d.missing.size) == 12) @@ -467,8 +467,7 @@ test_that("simplifyFragmentData when missing fragment sizes, low/rv/high", { test_that("simplifyFragmentData warning generated when NA in fragvol", { - expect_message(simplifyFragmentData(d.missing.fragvol, id.var = 'phiid', nullFragsAreZero = TRUE), - regexp = 'some records are missing rock fragment volume') + expect_silent(simplifyFragmentData(d.missing.fragvol, id.var = 'phiid', nullFragsAreZero = TRUE)) }) @@ -482,8 +481,8 @@ test_that("simplifyFragmentData warning generated when all fragvol are NA", { test_that("simplifyFragmentData nullFragsAreZero works as expected", { - expect_message( { a <- simplifyFragmentData(d.missing.fragvol, id.var = 'phiid', nullFragsAreZero = FALSE) } ) - expect_message( { b <- simplifyFragmentData(d.missing.fragvol, id.var = 'phiid', nullFragsAreZero = TRUE) } ) + expect_silent( { a <- simplifyFragmentData(d.missing.fragvol, id.var = 'phiid', nullFragsAreZero = FALSE) } ) + expect_silent( { b <- simplifyFragmentData(d.missing.fragvol, id.var = 'phiid', nullFragsAreZero = TRUE) } ) expect_equal(as.logical(is.na(a)), c(FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE))