Behavior specs cleanup: Improve zero or more specs
This commit is contained in:
parent
c377eff876
commit
b9a3b44cf2
|
@ -633,12 +633,14 @@ describe("generated parser behavior", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("zero or more", function() {
|
describe("zero or more", function() {
|
||||||
it("matches correctly", function() {
|
describe("when the expression matches zero or more times", function() {
|
||||||
var parser = PEG.buildParser('start = "a"*', options);
|
it("returns an array of its match results", function() {
|
||||||
|
var parser = PEG.buildParser('start = "a"*', options);
|
||||||
|
|
||||||
expect(parser).toParse("", []);
|
expect(parser).toParse("", []);
|
||||||
expect(parser).toParse("a", ["a"]);
|
expect(parser).toParse("a", ["a"]);
|
||||||
expect(parser).toParse("aaa", ["a", "a", "a"]);
|
expect(parser).toParse("aaa", ["a", "a", "a"]);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue