prints_text(regexp, ...)expect_output(object, regexp, ..., info = NULL, label = NULL)
matches
NULL
, computed from deparsed object.equals_reference
,
expect_equal_to_reference
;
equals
, expect_equal
;
expect-compare
,
expect_less_than
,
expect_more_than
,
is_less_than
, is_more_than
;
expect_equivalent
,
is_equivalent_to
;
expect_error
, throws_error
;
expect_false
, expect_true
,
is_false
, is_true
;
expect_identical
,
is_identical_to
; expect_is
,
is_a
; expect_match
,
matches
; expect_message
,
shows_message
; expect_named
,
has_names
; expect_null
,
is_null
; expect_warning
,
gives_warning
;
takes_less_than
str(mtcars)
expect_output(str(mtcars), "32 obs")
expect_output(str(mtcars), "11 variables")
# You can use the arguments of grepl to control the matching
expect_output(str(mtcars), "11 VARIABLES", ignore.case = TRUE)
expect_output(str(mtcars), "$ mpg", fixed = TRUE)
Run the code above in your browser using DataLab