Skip to content

Commit c5e1594

Browse files
committed
test-ggplot-bar and expect_true instead of stopifnot
1 parent 8ae1a20 commit c5e1594

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

inst/tests/test-bar.R renamed to inst/tests/test-ggplot-bar.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test_that("position_dodge is translated to barmode=group", {
1313
L <- gg2list(gg.dodge)
1414
expect_equal(length(L), 3)
1515
trace.names <- sapply(L[1:2], "[[", "name")
16-
stopifnot(c("Math", "Bio") %in% trace.names)
16+
expect_true(all(c("Math", "Bio") %in% trace.names))
1717
expect_identical(L$kwargs$layout$barmode, "group")
1818
})
1919

@@ -22,7 +22,7 @@ test_that("position_stack is translated to barmode=stack", {
2222
gg2list(gg.stack)
2323
expect_equal(length(L), 3)
2424
trace.names <- sapply(L[1:2], "[[", "name")
25-
stopifnot(c("Math", "Bio") %in% trace.names)
25+
expect_true(all(c("Math", "Bio") %in% trace.names))
2626
expect_identical(L$kwargs$layout$barmode, "stack")
2727
})
2828

@@ -31,7 +31,7 @@ test_that("position_identity is translated to barmode=overlay", {
3131
gg2list(gg.identity)
3232
expect_equal(length(L), 3)
3333
trace.names <- sapply(L[1:2], "[[", "name")
34-
stopifnot(c("Math", "Bio") %in% trace.names)
34+
expect_true(all(c("Math", "Bio") %in% trace.names))
3535
expect_identical(L$kwargs$layout$barmode, "overlay")
3636
})
3737

0 commit comments

Comments
 (0)