Skip to content

Commit e2edc12

Browse files
committed
Assert warning isntead of no error
1 parent 51435c4 commit e2edc12

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/testthat/test-FunctionReporter-class.R

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,10 @@ test_that(".parse_function falls back when as.list fails on listable objects", {
354354
expect_true(pkgnet:::.is_listable_expr(obj))
355355
expect_error(as.list(obj))
356356

357-
result <- expect_no_error(pkgnet:::.parse_function(obj))
357+
result <- expect_warning(
358+
pkgnet:::.parse_function(obj),
359+
regexp = "Expression parsing: as\\.list\\(\\) failed"
360+
)
358361
expect_true(is.character(result))
359362
expect_length(result, 1)
360363
})
@@ -368,7 +371,10 @@ test_that(".parse_R6_expression falls back when as.list fails on listable object
368371
expect_true(pkgnet:::.is_listable_expr(obj))
369372
expect_error(as.list(obj))
370373

371-
result <- expect_no_error(pkgnet:::.parse_R6_expression(obj))
374+
result <- expect_warning(
375+
pkgnet:::.parse_R6_expression(obj),
376+
regexp = "Expression parsing: as\\.list\\(\\) failed"
377+
)
372378
expect_true(is.character(result))
373379
expect_length(result, 1)
374380
})

0 commit comments

Comments
 (0)