Jasmine: Convert zero or more matching tests
This commit is contained in:
parent
1ab06ff906
commit
669668fc1b
|
@ -91,6 +91,18 @@ describe("generated parser", function() {
|
|||
});
|
||||
});
|
||||
|
||||
describe("zero or more matching", function() {
|
||||
varyAll(function(options) {
|
||||
it("matches correctly", function() {
|
||||
var parser = PEG.buildParser('start = "a"*', options);
|
||||
|
||||
expect(parser).toParse("", []);
|
||||
expect(parser).toParse("a", ["a"]);
|
||||
expect(parser).toParse("aaa", ["a", "a", "a"]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("one or more matching", function() {
|
||||
varyAll(function(options) {
|
||||
it("matches correctly", function() {
|
||||
|
|
|
@ -435,13 +435,6 @@ testWithVaryingTrackLineAndColumn("optional expressions", function(options) {
|
|||
parses(parser, "a", "a");
|
||||
});
|
||||
|
||||
testWithVaryingTrackLineAndColumn("zero or more expressions", function(options) {
|
||||
var parser = PEG.buildParser('start = "a"*', options);
|
||||
parses(parser, "", []);
|
||||
parses(parser, "a", ["a"]);
|
||||
parses(parser, "aaa", ["a", "a", "a"]);
|
||||
});
|
||||
|
||||
testWithVaryingTrackLineAndColumn("initializer", function(options) {
|
||||
var variableInActionParser = PEG.buildParser(
|
||||
'{ a = 42; }; start = "a" { return a; }',
|
||||
|
|
Loading…
Reference in a new issue