Skip to content

Commit

Permalink
Edit error message given with fromBalString
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadeeshan96 committed Dec 6, 2023
1 parent 1d85e9e commit 985e312
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ private static String getMapKey(String e, int colonIndex) {
if (key.startsWith("\"") && key.endsWith("\"")) {
key = key.substring(1, key.length() - 1);
} else {
throw ErrorCreator.createError(fromString("invalid expression style string value. " +
"map keys are not enclosed with '\"'."));
throw ErrorCreator.createError(fromString("invalid expression style string value: " +
"the map keys are not enclosed with '\"'."));
}
return key;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ function testMapFromBalString() {
output = mapExpString.fromBalString();
assert(output is error, true);
if (output is error) {
assert("invalid expression style string value. map keys are not enclosed with '\"'.",
assert("invalid expression style string value: the map keys are not enclosed with '\"'.",
<string>checkpanic output.detail()["message"]);
}

mapExpString = string `{name:"John",city:"London"}`;
output = mapExpString.fromBalString();
assert(output is error, true);
if (output is error) {
assert("invalid expression style string value. map keys are not enclosed with '\"'.",
assert("invalid expression style string value: the map keys are not enclosed with '\"'.",
<string>checkpanic output.detail()["message"]);
}

Expand Down Expand Up @@ -238,7 +238,7 @@ function testMapFromBalString() {
output = mapExpString.fromBalString();
assert(output is error, true);
if (output is error) {
assert("invalid expression style string value. map keys are not enclosed with '\"'.",
assert("invalid expression style string value: the map keys are not enclosed with '\"'.",
<string>checkpanic output.detail()["message"]);
}

Expand All @@ -249,7 +249,7 @@ function testMapFromBalString() {
output = mapExpString.fromBalString();
assert(output is error, true);
if (output is error) {
assert("invalid expression style string value. map keys are not enclosed with '\"'.",
assert("invalid expression style string value: the map keys are not enclosed with '\"'.",
<string>checkpanic output.detail()["message"]);
}

Expand All @@ -260,7 +260,7 @@ function testMapFromBalString() {
output = mapExpString.fromBalString();
assert(output is error, true);
if (output is error) {
assert("invalid expression style string value. map keys are not enclosed with '\"'.",
assert("invalid expression style string value: the map keys are not enclosed with '\"'.",
<string>checkpanic output.detail()["message"]);
}
}
Expand Down

0 comments on commit 985e312

Please sign in to comment.