Skip to content

Commit

Permalink
use comparison expectations for better failure messages
Browse files Browse the repository at this point in the history
  • Loading branch information
PietrH committed Nov 10, 2023
1 parent e7d99ad commit a31614d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions tests/testthat/test-get_cam_op.R
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,10 @@ test_that("daily effort is > 0 and < 1 for partial active days (start/end)", {
location <- mica$data$deployments$locationName[4]
start <- as.character(as.Date(mica$data$deployments$start[4]))
end <- as.character(as.Date(mica$data$deployments$end[4]))
expect_true(cam_op_matrix[4, start] > 0)
expect_true(cam_op_matrix[4, start] < 1)
expect_true(cam_op_matrix[4, end] > 0)
expect_true(cam_op_matrix[4, end] < 1)
expect_gt(cam_op_matrix[4, start], 0)
expect_lt(cam_op_matrix[4, start],1)
expect_gt(cam_op_matrix[4, end], 0)
expect_lt(cam_op_matrix[4, end], 1)
})

test_that(
Expand All @@ -283,8 +283,8 @@ test_that(
expect_true(
nrow(cam_op_matrix) == length(unique(mica1$data$deployments$locationName))
)
expect_true(cam_op_matrix[1, first_full_day_two_deps] > 1)
expect_true(cam_op_matrix[1, last_full_day_two_deps] > 1)
expect_gt(cam_op_matrix[1, first_full_day_two_deps], 1)
expect_gt(cam_op_matrix[1, last_full_day_two_deps], 1)
}
)

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-get_record_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ test_that("Higher minDeltaTime means less rows returned", {
deltaTimeComparedTo = "lastRecord"
)) %>%
nrow()
testthat::expect_true(nrow_delta_10000 < nrow_delta_0)
testthat::expect_true(nrow_delta_100000 < nrow_delta_10000)
expect_lt(nrow_delta_10000, nrow_delta_0)
expect_lt(nrow_delta_100000, nrow_delta_10000)
})

test_that("stations names are equal to values in column passed to StationCOl", {
Expand Down

0 comments on commit a31614d

Please sign in to comment.