Skip to content

Commit

Permalink
Add forgotten tests for |nonBraceCharacter| & |nonBraceCharacters| rules
Browse files Browse the repository at this point in the history
  • Loading branch information
dmajda committed May 7, 2012
1 parent 7900b66 commit 55a255a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/parser.spec.js
Expand Up @@ -327,6 +327,20 @@ describe("PEG.js grammar parser", function() {
expect('start = "abcd" {{a}{b}{c}}').toParseAs(actionGrammar("{a}{b}{c}"));
});

/* Canonical nonBraceCharacters is "abcd". */
it("parses nonBraceCharacters", function() {
expect('start = "abcd" {a}' ).toParseAs(actionGrammar("a"));
expect('start = "abcd" {abc}').toParseAs(actionGrammar("abc"));
});

/* Canonical nonBraceCharacter is "a". */
it("parses nonBraceCharacter", function() {
expect('start = "abcd" {a}').toParseAs(actionGrammar("a"));

expect('start = "abcd" {{}').toFailToParse();
expect('start = "abcd" {}}').toFailToParse();
});

/* Trivial character rules are not tested. */

/* Canonical identifier is "a". */
Expand Down

0 comments on commit 55a255a

Please sign in to comment.