Skip to content

Commit

Permalink
changed the error message caught in the tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
wendycwong committed Jul 30, 2024
1 parent dd297e2 commit 7653b84
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions h2o-algos/src/test/java/hex/glm/GLMConstrainedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ public void testDuplicateLinearConstraints() {
Scope.track_generic(glm2);
assert 1==2 : "Should have thrown an error due to duplicated constraints.";
} catch(IllegalArgumentException ex) {
assert ex.getMessage().contains("redundant and possibly conflicting linear constraints") : "Wrong error message. Error should be about" +
assert ex.getMessage().contains("redundant linear constraints:") : "Wrong error message. Error should be about" +
" redundant linear constraints";
} finally {
Scope.exit();
Expand Down Expand Up @@ -642,7 +642,7 @@ public void testDuplicateBetaLinearConstraints() {
Scope.track_generic(glm2);
assert 1==2 : "Should have thrown an error due to duplicated constraints.";
} catch(IllegalArgumentException ex) {
assert ex.getMessage().contains("redundant and possibly conflicting linear constraints") : "Wrong error message. Error should be about" +
assert ex.getMessage().contains("rredundant linear constraints:") : "Wrong error message. Error should be about" +
" redundant linear constraints";
} finally {
Scope.exit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def test_redundant_constraints():
except Exception as ex:
print(ex)
temp = str(ex)
assert ("redundant and possibly conflicting linear constraints" in temp), "Wrong exception was received."
assert ("redundant linear constraints:" in temp), "Wrong exception was received."
print("redundant constraint test passed!")

if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test_constraints_redundant <- function() {
}, error = function(e) {
print("***")
print(e)
expect_true(grepl("redundant and possibly conflicting linear constraints:", e))
expect_true(grepl("redundant linear constraints:", e))
})
}

Expand Down

0 comments on commit 7653b84

Please sign in to comment.