Skip to content

Commit a3a4fe4

Browse files
committed
Add resolution test
1 parent 612fa56 commit a3a4fe4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/testthat/test-utilities.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,11 @@ test_that("vec_rbind0 can combined ordered factors", {
166166
expect_equal(levels(test$a), c("A", "B", "C"))
167167

168168
})
169+
170+
test_that("resolution() gives correct answers", {
171+
expect_equal(resolution(c(4, 6)), 2)
172+
expect_equal(resolution(c(4L, 6L)), 1L)
173+
expect_equal(resolution(mapped_discrete(c(4, 6))), 1L)
174+
expect_equal(resolution(c(0, 0)), 1L)
175+
expect_equal(resolution(c(0.5, 1.5), zero = TRUE), 0.5)
176+
})

0 commit comments

Comments
 (0)