Skip to content

Commit

Permalink
Refinement on max valid values
Browse files Browse the repository at this point in the history
  • Loading branch information
symphony-youri committed Oct 27, 2021
1 parent 23e2867 commit 27ab359
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void validate() throws InvalidInputException {
}

int min = checkIntegerAttribute(MIN_ATTR, 0, "Attribute \"min\" is not valid, it must be >= 0");
int max = checkIntegerAttribute(MAX_ATTR, 2, "Attribute \"max\" is not valid, it must be >= 2");
int max = checkIntegerAttribute(MAX_ATTR, 1, "Attribute \"max\" is not valid, it must be >= 1");
if (max > 0 && min > max) {
throw new InvalidInputException("Attribute \"min\" is greater than attribute \"max\"");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ public void testMultiSelectMaxInvalid() throws Exception {
//language=XML
String input = "<messageML>\n" +
" <form id=\"" + "id" + "\">\n"
+ " <select name=\"" + "multi" + "\" multiple=\"true\" max=\"1\">\n"
+ " <select name=\"" + "multi" + "\" multiple=\"true\" max=\"0\">\n"
+ " <option value=\"opt1\">Option 1</option>\n"
+ " <option value=\"opt2\">Option 2</option>\n"
+ " </select>\n"
Expand Down

0 comments on commit 27ab359

Please sign in to comment.