Skip to content

Commit

Permalink
filling test coverage for anlz_metseason and anlz_avgseason
Browse files Browse the repository at this point in the history
  • Loading branch information
fawda123 committed Mar 3, 2024
1 parent 413334f commit 5f4bfa8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/testthat/test-anlz_avgseason.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,14 @@ test_that("Checking error, insufficient inputs", {

expect_error(anlz_avgseason(doystr = 90, doyend = 180))

})
})

test_that("Checking yromit", {

result <- anlz_avgseason(mod, doystr = 90, doyend = 180, yromit = 2016)

# excpect NA for 2016
expected <- na.omit(result)$yr
expect_equal(expected, c(2017, 2018, 2019))

})
10 changes: 10 additions & 0 deletions tests/testthat/test-anlz_metseason.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@ test_that("Checking error, insufficient inputs", {
expect_error(anlz_metseason(doystr = 90, doyend = 180, nsim = 5))

})

test_that("Checking yromit", {

result <- anlz_metseason(mod, doystr = 90, doyend = 180, nsim = 5, yromit = 2016)

# excpect NA for 2016
expected <- na.omit(result)$yr
expect_equal(expected, c(2017, 2018, 2019))

})

0 comments on commit 5f4bfa8

Please sign in to comment.