Behavior specs cleanup: Improve text specs

redux
David Majda 9 years ago
parent bb708490a0
commit c5c44b9d0c

@ -664,13 +664,23 @@ describe("generated parser behavior", function() {
});
describe("text", function() {
it("matches correctly", function() {
describe("when the expression matches", function() {
it("returns the matched text", function() {
var parser = PEG.buildParser('start = $("a" "b" "c")', options);
expect(parser).toParse("abc", "abc");
});
});
describe("when the expression doesn't match", function() {
it("reports match failure", function() {
var parser = PEG.buildParser('start = $("a")', options);
expect(parser).toFailToParse("b");
});
});
});
describe("positive simple predicate", function() {
it("matches correctly", function() {
var parser = PEG.buildParser('start = &"a" "a"', options);

Loading…
Cancel
Save