diff --git a/prism/src/parser/ast/Property.java b/prism/src/parser/ast/Property.java index 77e3bc3f..a3b32342 100644 --- a/prism/src/parser/ast/Property.java +++ b/prism/src/parser/ast/Property.java @@ -152,7 +152,7 @@ public class Property extends ASTElement // Extract expected result(s) from comment if (comment != null) { // Look for "RESULT: val" or "RESULT (x=1,y=2): val" - Pattern p = Pattern.compile("RESULT[ \t]*(\\(([^\\)]+)\\))?[ \t]*:[ \t]*([^ \t\n\r]+)"); + Pattern p = Pattern.compile("RESULT[ \t]*(\\(([^\\)]+)\\))?[ \t]*:[ \t]*([^\n\r]+)"); Matcher matcher = p.matcher(comment); // Look at each RESULT specification found while (matcher.find()) { @@ -266,8 +266,9 @@ public class Property extends ASTElement if (strExpected.startsWith("Error:")) { String words[] = strExpected.substring(6).split(","); for (String word : words) { - if (!errMsg.contains(word)) { - throw new PrismException("Error message should contain \"" + word + "\""); + String mustContain = word.trim(); + if (!errMsg.contains(mustContain)) { + throw new PrismException("Error message should contain \"" + mustContain + "\""); } } }