diff --git a/spec/parser.spec.js b/spec/parser.spec.js index aa51678..f97893c 100644 --- a/spec/parser.spec.js +++ b/spec/parser.spec.js @@ -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")); diff --git a/test/parser-test.js b/test/parser-test.js index 5fdaf14..8970daf 100644 --- a/test/parser-test.js +++ b/test/parser-test.js @@ -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")); -}); - })();