mllg / checkmate

Fast and versatile argument checks
https://mllg.github.io/checkmate/
Other
263 stars 30 forks source link

[Feature request] expect_permutation #227

Open sebffischer opened 2 years ago

sebffischer commented 2 years ago

I looked at the uses of expect_set_equal in my own code, as well as in the mlr repositories and it seems that in quite some cases where we currently use the function, what we actually want to test is whether the two objects are permutation-equivalent and not set-equivalent, in the sense that

expect_set_equal(c("a", "b", "a"), c("a, "b")) # does not fail but should fail

# this should be replaced with
expect_permutation(c("a", "b", "a"), c("a, "b")) # fails!
sebffischer commented 2 years ago

I can make a PR if you think this would be useful

mllg commented 2 years ago

Sounds good to me.

sebffischer commented 2 years ago

Created a PR https://github.com/mllg/checkmate/pulls