diff --git a/spec/parser.spec.js b/spec/parser.spec.js index 59b55c0..aa51678 100644 --- a/spec/parser.spec.js +++ b/spec/parser.spec.js @@ -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([], "[]")); diff --git a/test/parser-test.js b/test/parser-test.js index 1e81aeb..5fdaf14 100644 --- a/test/parser-test.js +++ b/test/parser-test.js @@ -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'"); -}); - })();