Browse Source

Regression testing: allow spaces in "Error" RESULT specifications.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@10259 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 11 years ago
parent
commit
cdbc634b26
  1. 7
      prism/src/parser/ast/Property.java

7
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 + "\"");
}
}
}

Loading…
Cancel
Save