Skip to content

Commit

Permalink
test range polarization
Browse files Browse the repository at this point in the history
  • Loading branch information
robitalec committed Oct 8, 2024
1 parent 512ab61 commit 6190ff0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/testthat/test-direction-polarization.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ test_that('one column added to the result DT', {
ncol(direction_polarization(DT)))
})

test_that('column added to the result DT is numeric', {
test_that('column added to the result DT is numeric, between 0-1', {
expect_type(direction_polarization(DT)$polarization, 'double')
expect_gte(min(direction_polarization(DT)$polarization, na.rm = TRUE), 0)
expect_lte(max(direction_polarization(DT)$polarization, na.rm = TRUE), 1)
})

test_that('returns a data.table', {
Expand Down

0 comments on commit 6190ff0

Please sign in to comment.