Behavior specs cleanup: Improve label specs

redux
David Majda 9 years ago
parent c5c44b9d0c
commit 52144e48cb

@ -724,13 +724,22 @@ describe("generated parser behavior", function() {
});
describe("label", function() {
it("delegates to the expression", function() {
describe("when the expression matches", function() {
it("returns its match result", function() {
var parser = PEG.buildParser('start = a:"a"', options);
expect(parser).toParse("a", "a");
});
});
describe("when the expression doesn't match", function() {
it("reports match failure", function() {
var parser = PEG.buildParser('start = a:"a"', options);
expect(parser).toFailToParse("b");
});
});
});
describe("sequence", function() {
it("matches correctly", function() {

Loading…
Cancel
Save