How can I test that two objects in R are not equal? There is no complement to the expect_equal() function, such as expect_not_equal().
The answer didn't pop into my head at first, so I tried searching online however most just made it needlessly complicated (at least for the purposes of writing automated tests) with base R or directly using compare() commands etc.
Simply do
expect_failure(expect_equal(object1, object2)), or the same for expect_identical and I guess anything else you want to check failure for.A simple solution but at least for me I missed it at first, and then Google searches just confused me more.