Skip to content

Commit

Permalink
test zzz columns are not in result
Browse files Browse the repository at this point in the history
  • Loading branch information
robitalec committed Nov 1, 2024
1 parent 36b2c80 commit 0c05181
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/testthat/test-direction-to-leader.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ test_that('column added to the result DT is a double', {
)
})

test_that('zzz columns not added to the result', {
zzz_cols <- c('has_leader', 'zzz_leader_xcol', 'zzz_leader_ycol')

expect_false(
any(zzz_cols %in% colnames(direction_to_leader(DT, coords = coords)))
)
})

test_that('returns a data.table', {
expect_s3_class(direction_to_leader(DT, coords = coords, group = group),
'data.table')
Expand Down
8 changes: 8 additions & 0 deletions tests/testthat/test-distance-to-leader.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ test_that('column added to the result DT is a double', {
)
})

test_that('zzz columns not added to the result', {
zzz_cols <- c('has_leader', 'zzz_N_by_group')

expect_false(
any(zzz_cols %in% colnames(direction_to_leader(DT, coords = coords)))
)
})

test_that('returns a data.table', {
expect_s3_class(distance_to_leader(DT, coords = coords, group = group),
'data.table')
Expand Down

0 comments on commit 0c05181

Please sign in to comment.