|
|
@ -38,6 +38,7 @@ describe("generated parser behavior", function() {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
result = this.actual.parse(input, options);
|
|
|
|
result = this.actual.parse(input, options);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (arguments.length > 1) {
|
|
|
|
this.message = function() {
|
|
|
|
this.message = function() {
|
|
|
|
return "Expected " + jasmine.pp(input) + " "
|
|
|
|
return "Expected " + jasmine.pp(input) + " "
|
|
|
|
+ "with options " + jasmine.pp(options) + " "
|
|
|
|
+ "with options " + jasmine.pp(options) + " "
|
|
|
@ -47,11 +48,14 @@ describe("generated parser behavior", function() {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return this.env.equals_(result, expected);
|
|
|
|
return this.env.equals_(result, expected);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
this.message = function() {
|
|
|
|
this.message = function() {
|
|
|
|
return "Expected " + jasmine.pp(input) + " "
|
|
|
|
return "Expected " + jasmine.pp(input) + " "
|
|
|
|
+ "with options " + jasmine.pp(options) + " "
|
|
|
|
+ "with options " + jasmine.pp(options) + " "
|
|
|
|
+ "to parse as " + jasmine.pp(expected) + ", "
|
|
|
|
+ "to parse" + (arguments.length > 1 ? " as " + jasmine.pp(expected) : "") + ", "
|
|
|
|
+ "but it failed to parse with message "
|
|
|
|
+ "but it failed to parse with message "
|
|
|
|
+ jasmine.pp(e.message) + ".";
|
|
|
|
+ jasmine.pp(e.message) + ".";
|
|
|
|
};
|
|
|
|
};
|
|
|
|