diff --git a/tests/testthat/test-direction-to-leader.R b/tests/testthat/test-direction-to-leader.R index d44c9f99..9dced628 100644 --- a/tests/testthat/test-direction-to-leader.R +++ b/tests/testthat/test-direction-to-leader.R @@ -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') diff --git a/tests/testthat/test-distance-to-leader.R b/tests/testthat/test-distance-to-leader.R index f00c24fa..844b8b29 100644 --- a/tests/testthat/test-distance-to-leader.R +++ b/tests/testthat/test-distance-to-leader.R @@ -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')