Skip to content

Commit

Permalink
expanding test coverage for anlz_fibmatrix
Browse files Browse the repository at this point in the history
  • Loading branch information
fawda123 committed Sep 25, 2024
1 parent 11d5f9a commit e092f78
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/testthat/test-anlz_fibmatrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,23 @@ test_that("Check error if bay segment is not null for epchc data", {
fixed = T)

})

test_that("Checking anlz_fibmatrix if bay segment is not null for non-epchc data", {
result <- anlz_fibmatrix(enterodata, indic = 'entero', bay_segment = 'HB')
expect_true('HB' %in% result$grp)
})

test_that("Checking anlz_fibmatrix if bay segment is null and stas is null for non-epchc data", {
result <- anlz_fibmatrix(enterodata, indic = 'entero')
expect_true(any(grepl('FLHILL', result$grp)))
})

test_that("Checking anlz_fibmatrix yrrng[1] as NA", {
result <- anlz_fibmatrix(fibdata, indic = 'fcolif', yrrng = c(NA, 2010))
expect_true(min(result$yr) < 2010)
})

test_that("Checking anlz_fibmatrix yrrng[2] as NA", {
result <- anlz_fibmatrix(fibdata, indic = 'fcolif', yrrng = c(2010, NA))
expect_true(max(result$yr) > 2010)
})

0 comments on commit e092f78

Please sign in to comment.