Expectation predicate for testing that the sets of two vectors are equal
expect_setequal(current, target, ..., info = NA_character_)A tinytest object. A tinytest object is a
logical with attributes holding information about the
test that was run
testthat equivalent:
testthat::expect_setequal()
Other in-condition expectation predicates:
expect_contains(),
expect_in(),
expect_mapequal()
expect_setequal(letters, target = rev(letters)) # Pass
#> ----- PASSED : <-->
#> call| expect_setequal(letters, target = rev(letters))
expect_setequal(letters, target = "b") # Fail
#> ----- FAILED[xcpt]: <-->
#> call| expect_setequal(letters, target = "b")
#> diff| Expected 'current' and 'target' to be identical sets
expect_setequal("b", target = letters) # Fail
#> ----- FAILED[xcpt]: <-->
#> call| expect_setequal("b", target = letters)
#> diff| Expected 'current' and 'target' to be identical sets