Jasmine: Convert labeled matching tests

redux
David Majda 12 years ago
parent b013ba8cc9
commit ae8a89c9e4

@ -91,6 +91,17 @@ describe("generated parser", function() {
});
});
describe("labeled matching", function() {
varyAll(function(options) {
it("delegates to the expression", function() {
var parser = PEG.buildParser('start = a:"a"', options);
expect(parser).toParse("a", "a");
expect(parser).toFailToParse("b");
});
});
});
describe("simple and matching", function() {
varyAll(function(options) {
it("matches correctly", function() {

@ -43,12 +43,6 @@ testWithVaryingTrackLineAndColumn("sequences", function(options) {
parses(posTestParser, "a", "a");
});
testWithVaryingTrackLineAndColumn("labels", function(options) {
var parser = PEG.buildParser('start = label:"a"', options);
parses(parser, "a", "a");
doesNotParse(parser, "b");
});
testWithVaryingTrackLineAndColumn("initializer", function(options) {
var variableInActionParser = PEG.buildParser(
'{ a = 42; }; start = "a" { return a; }',

Loading…
Cancel
Save