Skip to content

Commit a1a239c

Browse files
author
Lindsay Carr
committed
tests for indexing
1 parent 818e503 commit a1a239c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/testthat/tests-points.R

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,18 @@ test_that("points.gsplot accepts formulas",{
5858

5959
})
6060

61+
test_that("points works with indexing", {
62+
63+
x <- 7:10
64+
gs <- gsplot() %>%
65+
points(x)
66+
expect_equal(class(gs$view.1.2$points$y), "integer")
67+
expect_equal(gs$view.1.2$points$x, seq_along(x))
68+
69+
70+
oct_dates <- seq(as.Date("2015-10-11"), as.Date("2015-10-15"), by="days")
71+
gs_dates <- gsplot() %>%
72+
points(oct_dates)
73+
expect_equal(class(gs_dates$view.1.2$points$y), "Date")
74+
expect_equal(gs_dates$view.1.2$points$x, seq_along(oct_dates))
75+
})

0 commit comments

Comments
 (0)