Jasmine: Convert tests of parser's "simpleSingleQuotedCharacter" rule

redux
David Majda 12 years ago
parent ba68919b0a
commit 124e45606c

@ -115,6 +115,15 @@ describe("PEG.js grammar parser", function() {
});
});
/* Canonical simpleSingleQuotedCharacter is "a". */
it("parses simpleSingleQuotedCharacter", function() {
expect("start = 'a'").toParseAs(literalGrammar("a"));
expect("start = '''" ).toFailToParse();
expect("start = '\\'").toFailToParse();
expect("start = '\n'").toFailToParse();
});
/* Canonical class is "[a-d]". */
it("parses class", function() {
expect('start = []' ).toParseAs(classGrammar([], "[]"));

@ -401,16 +401,4 @@ test("parses singleQuotedCharacter", function() {
parserParses("start = '\\\n'", literalGrammar("\n"));
});
/* Canonical simpleSingleQuotedCharacter is "a". */
test("parses simpleSingleQuotedCharacter", function() {
parserParses("start = 'a'", literalGrammar("a"));
parserParses("start = '\"'", literalGrammar("\""));
parserDoesNotParse("start = '''");
parserDoesNotParse("start = '\\'");
parserDoesNotParse("start = '\n'");
parserDoesNotParse("start = '\r'");
parserDoesNotParse("start = '\u2028'");
parserDoesNotParse("start = '\u2029'");
});
})();

Loading…
Cancel
Save