Change error message for positive integer
This commit is contained in:
@@ -39,11 +39,7 @@ public class ValueParsers {
|
||||
str = str.replace("_", ""); //Tolerate and ignore underscores in integers.
|
||||
int value = Integer.parseInt(str);
|
||||
if (lowerBound!=null && value<lowerBound) {
|
||||
if (lowerBound==0) {
|
||||
throw new NumberFormatException("Value must be positive");
|
||||
} else {
|
||||
throw new NumberFormatException("Value must be at least "+lowerBound);
|
||||
}
|
||||
throw new NumberFormatException("Value must be at least "+lowerBound);
|
||||
}
|
||||
if (upperBound!=null && value>upperBound) {
|
||||
throw new NumberFormatException("Value must be at most "+upperBound);
|
||||
|
||||
@@ -513,7 +513,7 @@ public class ConcourseEditorTest {
|
||||
);
|
||||
editor.assertProblems(
|
||||
"boohoo|boolean",
|
||||
"-1|must be positive",
|
||||
"-1|must be at least 0",
|
||||
"git|resource does not exist",
|
||||
"yohoho|boolean",
|
||||
"0|must be at least 1",
|
||||
@@ -1338,7 +1338,7 @@ public class ConcourseEditorTest {
|
||||
" clean_tags: not-bool-d\n"
|
||||
);
|
||||
editor.assertProblems(
|
||||
"-1|must be positive",
|
||||
"-1|must be at least 0",
|
||||
"not-bool-a|'boolean'",
|
||||
"not-bool-b|'boolean'",
|
||||
"not-bool-c|'boolean'",
|
||||
|
||||
Reference in New Issue
Block a user