Skip to content

Commit

Permalink
flagOverlappingHz: add a test for more complex overlap (DSP lab sampl…
Browse files Browse the repository at this point in the history
…ing example)
  • Loading branch information
brownag committed Feb 1, 2024
1 parent 01515bf commit 37d6e81
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/testthat/test-flagOverlappingHz.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,23 @@ test_that("flagOverlappingHz", {

})


# more complex edge case
x <- data.frame(peiid = c("1373969", "1373969", "1373969", "1373969",
"1373969", "1373969", "1373969", "1373969", "1373969", "1373969",
"1373969", "1373969"), hzdept = c(0L, 0L, 0L, 0L,
26L, 45L, 77L, 102L, 102L, 102L, 185L, 205L), hzdepb = c(26L,
26L, 26L, 26L, 45L, 77L, 102L, 185L, 185L, 185L, 205L, 220L),
hzname = c("Ap", "Ap", "Ap", "Ap", "Bt1", "Bt2", "BCt", "Cd",
"Cd", "Cd", "2C1", "2C2"), texture = c("L", "L", "L", "L",
"CL", "CL", "CL", "L", "L", "L", "SR- VFSL L", "S"))

depths(x) <- peiid ~ hzdept + hzdepb

test_that("edge case", {
expect_equal(as.logical(flagOverlappingHz(x)),
c(TRUE, TRUE, TRUE, TRUE,
FALSE, FALSE, FALSE,
TRUE, TRUE, TRUE,
FALSE, FALSE))
})

0 comments on commit 37d6e81

Please sign in to comment.