1 require(1 == 2).assertErrorsWith("requirement failed."); 2 require(1 == 2, "%s is not true").assertErrorsWith("%s is not true"); 3 require(1 == 2, "%s is not true", "1 == 2").assertErrorsWith("1 == 2 is not true"); 4 5 require(1 == 1).assertErrorsWith("requirement failed.") 6 .assertErrorsWith("Error: No exception was thrown.");
Verify that calling expr throws and contains the exception message msg.