Behavior specs cleanup: Improve zero or more specs
This commit is contained in:
parent
c377eff876
commit
b9a3b44cf2
|
@ -633,7 +633,8 @@ 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() {
|
||||||
|
it("returns an array of its match results", function() {
|
||||||
var parser = PEG.buildParser('start = "a"*', options);
|
var parser = PEG.buildParser('start = "a"*', options);
|
||||||
|
|
||||||
expect(parser).toParse("", []);
|
expect(parser).toParse("", []);
|
||||||
|
@ -641,6 +642,7 @@ describe("generated parser behavior", function() {
|
||||||
expect(parser).toParse("aaa", ["a", "a", "a"]);
|
expect(parser).toParse("aaa", ["a", "a", "a"]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("one or more", function() {
|
describe("one or more", function() {
|
||||||
it("matches correctly", function() {
|
it("matches correctly", function() {
|
||||||
|
|
Loading…
Reference in a new issue