Skip to content

Commit

Permalink
#304 fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vaadin-miki committed Aug 10, 2021
1 parent 448423a commit 86eee19
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ public void testIntegerPartRequired() {
this.getField().setMinimumFractionDigits(0);
Arrays.asList(2, 3, 5, 7, 9, 11).forEach(maxDigits -> {
this.getField().setMaximumIntegerDigits(maxDigits);
this.getField().setIntegerPartOptional(true);
this.getField().setIntegerPartOptional(false);
// integer part is required by default, so ALL entries should be incorrect
String regexp = this.getField().getRegexp();
for (String s : onlyWhenNotRequired)
Assert.assertFalse(String.format("input %s must not match %s when integer part (max size %d) is required", s, regexp, maxDigits), s.matches(regexp));

this.getField().setIntegerPartOptional(false);
this.getField().setIntegerPartOptional(true);
regexp = this.getField().getRegexp();
for (String s : onlyWhenNotRequired)
Assert.assertTrue(String.format("input %s must match %s when integer part (max size %d) is optional", s, regexp, maxDigits), s.matches(regexp));
Expand Down

0 comments on commit 86eee19

Please sign in to comment.