Skip to content

Commit 984528b

Browse files
committed
add positive/negative control to test
1 parent 735eabf commit 984528b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/testthat/test-ggproto.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ test_that("all ggproto methods start with `{` (#6459)", {
4242
))
4343
}
4444

45+
# Test to make sure we're testing correctly
46+
ctrl <- list(
47+
foo = ggproto("Dummy", dummy = function(x) x + 10),
48+
bar = ggproto("Dummy", dummy = function(x) {x + 10})
49+
)
50+
ctrl <- lapply(ctrl, report_no_bracket)
51+
expect_equal(ctrl, list(foo = "dummy", bar = character()))
52+
53+
# Actual relevant test
4554
failures <- lapply(ggprotos, report_no_bracket)
4655
failures <- failures[lengths(failures) > 0]
4756
expect_equal(failures, list())

0 commit comments

Comments
 (0)