Skip to content

Commit

Permalink
test longlat returns at least one na radian
Browse files Browse the repository at this point in the history
  • Loading branch information
robitalec committed Nov 19, 2024
1 parent b72adba commit b2788bf
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/testthat/test-direction-step.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,24 @@ test_that('splitBy returns expected', {

)
})


DT_A <- data.table(
x = c(-5, -5, 0, 14, 10, 0),
y = c(5, 3, 1, 1, 11, 11),
id = 'A'
)[, timegroup := seq.int(.N)]

# Related to: PR 92
test_that('longlat NA radian returned', {
expect_equal(
direction_step(DT_A, id = 'id', coords = c('x', 'y'),
projection = 4326)[]$direction |> class(),
'units'
)
expect_gte(
sum(is.na(direction_step(DT_A, id = 'id', coords = c('x', 'y'),
projection = 4326)[]$direction)),
1
)
})

0 comments on commit b2788bf

Please sign in to comment.