diff --git a/spec/generated-parser.spec.js b/spec/generated-parser.spec.js index 43fa0f3..8c1467f 100644 --- a/spec/generated-parser.spec.js +++ b/spec/generated-parser.spec.js @@ -91,6 +91,23 @@ describe("generated parser", function() { }); }); + describe("simple and matching", function() { + varyAll(function(options) { + it("matches correctly", function() { + var parser = PEG.buildParser('start = &"a" "a"', options); + + expect(parser).toParse("a", ["", "a"]); + expect(parser).toFailToParse("b"); + }); + + it("does not advance position on success", function() { + var parser = PEG.buildParser('start = &"a" "a"', options); + + expect(parser).toParse("a", ["", "a"]); + }); + }); + }); + describe("simple not matching", function() { varyAll(function(options) { it("matches correctly", function() { diff --git a/test/compiler-test.js b/test/compiler-test.js index c1e1d76..9cb990b 100644 --- a/test/compiler-test.js +++ b/test/compiler-test.js @@ -49,17 +49,6 @@ testWithVaryingTrackLineAndColumn("labels", function(options) { doesNotParse(parser, "b"); }); -testWithVaryingTrackLineAndColumn("simple and", function(options) { - var parser = PEG.buildParser('start = "a" &"b" "b"', options); - parses(parser, "ab", ["a", "", "b"]); - doesNotParse(parser, "ac"); - - /* - * Test that the parsing position returns after successful parsing of a - * predicate is not needed, it is implicit in the tests above. - */ -}); - testWithVaryingTrackLineAndColumn("initializer", function(options) { var variableInActionParser = PEG.buildParser( '{ a = 42; }; start = "a" { return a; }',