Skip to content

Commit deac863

Browse files
committed
add tests
1 parent d8d0726 commit deac863

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/testthat/test-limits.R

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
test_that("limits_include gives expected results", {
2+
x <- limits_include(2)(c(-5, -1))
3+
expect_equal(x, c(-5, 2))
4+
5+
x <- limits_include(-2)(c(5, 1))
6+
expect_equal(x, c(-2, 5))
7+
})
8+
9+
test_that("limits_center gives expected results", {
10+
x <- limits_center(-1)(c(0, 1))
11+
expect_equal(x, c(-3, 1))
12+
13+
x <- limits_center(1)(c(0, 1))
14+
expect_equal(x, c(0, 2))
15+
})

0 commit comments

Comments
 (0)