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

redux
David Majda 13 years ago
parent 124e45606c
commit d3b3fe9b78

@ -115,6 +115,16 @@ describe("PEG.js grammar parser", function() {
});
});
/* Canonical singleQuotedCharacter is "a". */
it("parses singleQuotedCharacter", function() {
expect("start = 'a'" ).toParseAs(literalGrammar("a"));
expect("start = '\\n'" ).toParseAs(literalGrammar("\n"));
expect("start = '\\0'" ).toParseAs(literalGrammar("\x00"));
expect("start = '\\xFF'" ).toParseAs(literalGrammar("\xFF"));
expect("start = '\\uFFFF'").toParseAs(literalGrammar("\uFFFF"));
expect("start = '\\\n'" ).toParseAs(literalGrammar("\n"));
});
/* Canonical simpleSingleQuotedCharacter is "a". */
it("parses simpleSingleQuotedCharacter", function() {
expect("start = 'a'").toParseAs(literalGrammar("a"));

@ -391,14 +391,4 @@ test("parses singleQuotedString", function() {
parserParses("start = 'abc'", literalGrammar("abc"));
});
/* Canonical singleQuotedCharacter is "a". */
test("parses singleQuotedCharacter", function() {
parserParses("start = 'a'", literalGrammar("a"));
parserParses("start = '\\n'", literalGrammar("\n"));
parserParses("start = '\\0'", literalGrammar("\x00"));
parserParses("start = '\\x00'", literalGrammar("\x00"));
parserParses("start = '\\u0120'", literalGrammar("\u0120"));
parserParses("start = '\\\n'", literalGrammar("\n"));
});
})();

Loading…
Cancel
Save