Skip to content

Commit 048860a

Browse files
committed
Fix tests
1 parent 8ddb696 commit 048860a

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

tests/testthat/test-legend.R

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@ test_that("gsplot legend works", {
2121
legend(location="bottomright", bg="lightgrey")
2222

2323
expect_is(gs, "gsplot")
24-
expect_equal(gs$legend$gs.config$bg, "lightgrey")
25-
expect_equal(gs$legend$gs.config$location, "bottomright")
26-
expect_equal(length(which(names(gs$legend)=="legend.args")), 1)
27-
expect_equal(gs$legend$legend.args$fill[[1]], quote(par("bg")))
28-
expect_true(is.na(gs$legend$legend.args$lwd[4]))
29-
expect_true(is.na(gs$legend$legend.args$density[2]))
30-
# expect_equal(gs$legend$legend.args$text.font[[3]], 2)
24+
expect_equal(gs$legend$legend.auto$bg, "lightgrey")
25+
expect_equal(gs$legend$legend.auto$location, "bottomright")
26+
expect_equal(gs$legend$legend.auto$fill[[1]], quote(par("bg")))
27+
expect_true(is.na(gs$legend$legend.auto$lwd[4]))
28+
expect_true(is.na(gs$legend$legend.auto$density[2]))
29+
expect_equal(gs$legend$legend.auto$text.font[[3]], 2)
3130
# text.font not changing + error_bar comes through as "arrows" for legend.name
3231

3332
})

tests/testthat/test-legend_args.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ test_that("legend user args", {
55
points(x=1, y=2, side=c(3,2), legend.name="Points 1", cex=3, xlab='cat', col='dogerblue') %>%
66
lines(x=c(3,4,3), y=c(2,4,6), legend.name="Lines 1", lty=5, col="orange") %>%
77
legend()
8-
expect_equal(usrDef$legend$legend.args$col, c('dogerblue','orange'))
8+
expect_equal(usrDef$legend$legend.auto$col, c('dogerblue','orange'))
99
})

0 commit comments

Comments
 (0)