Skip to content

Commit 591803b

Browse files
committed
Add grid test.
1 parent 5517e74 commit 591803b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/testthat/tests-abline.R

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,19 @@ test_that("arrows gsplot",{
4747
s <- seq(length(x)-1) # one shorter than data
4848
gs = arrows(gs, x[s], y[s], x[s+1], y[s+1], col= 1:3)
4949
expect_equal(gs$view$arrows$col, 1:3)
50+
})
51+
52+
test_that("grid",{
53+
plot(1:10)
54+
grid()
55+
56+
gs <- gsplot() %>%
57+
points(1:10,1:10) %>%
58+
axis(side=1, at=seq(1,10,length.out=18),las=3) %>%
59+
axis(side=3, labels=FALSE) %>%
60+
grid(side=c(1,2),col="green") %>%
61+
grid(side=c(3,4))
62+
expect_equal(names(gs$view),c("points","grid","window"))
63+
expect_equal(gs$view$grid$col,"green")
64+
5065
})

0 commit comments

Comments
 (0)