diff --git a/spec/parser.spec.js b/spec/parser.spec.js index 265d53a..b6f1a21 100644 --- a/spec/parser.spec.js +++ b/spec/parser.spec.js @@ -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")); diff --git a/test/parser-test.js b/test/parser-test.js index a893b50..4e0977b 100644 --- a/test/parser-test.js +++ b/test/parser-test.js @@ -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")); -}); - })();