Skip to content

Commit badfd97

Browse files
author
Jordan S Read
committed
test for extra args
1 parent a51a24a commit badfd97

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

R/axis.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ axis.gsplot <- function(object, ..., n.minor=0, tcl.minor=0.15, reverse=NULL, ap
8686
user.args[[fun.name]]$n.minor <- n.minor
8787
user.args[[fun.name]]$tcl.minor <- tcl.minor
8888

89-
user.args[[fun.name]] <- append(args$call.args[[fun.name]], args$option.args)
89+
user.args[[fun.name]] <- append_replace(user.args[[fun.name]], args$option.args)
9090

9191
for(side in sides){
9292
# append the side and give it defaults if it doesn't exist

tests/testthat/tests-axis.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ test_that("par args sent to axis() end up in axis args",{
9090
expect_equal(gs$side.1$axis[["tcl"]], -0.25)
9191
})
9292

93+
test_that("special args given to axis are retained", {
94+
gs <- points(gsplot(), 1, 0) %>% axis(side=1, n.minor = 4)
95+
expect_equal(gs$side.1$axis[["n.minor"]], 4)
96+
97+
gs <- points(gsplot(), 1, 0) %>% axis(side=1, tcl.minor = -0.136)
98+
expect_equal(gs$side.1$axis[["tcl.minor"]], -0.136)
99+
})
100+
93101

94102
test_that("minor ticks get default direction and size from major ticks",{
95103
# tcl

0 commit comments

Comments
 (0)