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

redux
David Majda 12 years ago
parent 2f5f8d5932
commit 0e384b31f4

@ -115,6 +115,16 @@ describe("PEG.js grammar parser", function() {
});
});
/* Canonical doubleQuotedCharacter is "a". */
it("parses doubleQuotedCharacter", 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 simpleDoubleQuotedCharacter is "a". */
it("parses simpleDoubleQuotedCharacter", function() {
expect('start = "a"').toParseAs(literalGrammar("a"));

@ -362,14 +362,4 @@ test("parses doubleQuotedString", function() {
parserParses('start = "abc"', literalGrammar("abc"));
});
/* Canonical doubleQuotedCharacter is "a". */
test("parses doubleQuotedCharacter", 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