diff --git a/spec/parser.spec.js b/spec/parser.spec.js index f2b3309..29c3c37 100644 --- a/spec/parser.spec.js +++ b/spec/parser.spec.js @@ -45,6 +45,15 @@ describe("PEG.js grammar parser", function() { }); }); + /* Canonical eol is "\n". */ + it("parses eol", function() { + expect('start =\n"abcd"' ).toParseAs(trivialGrammar); + expect('start =\r\n"abcd"' ).toParseAs(trivialGrammar); + expect('start =\r"abcd"' ).toParseAs(trivialGrammar); + expect('start =\u2028"abcd"').toParseAs(trivialGrammar); + expect('start =\u2029"abcd"').toParseAs(trivialGrammar); + }); + /* Canonical eolChar is "\n". */ it("parses eolChar", function() { expect('start =\n"abcd"' ).toParseAs(trivialGrammar); diff --git a/test/parser-test.js b/test/parser-test.js index 8c79b21..afc4af7 100644 --- a/test/parser-test.js +++ b/test/parser-test.js @@ -563,13 +563,4 @@ test("parses multiLineComment", function() { parserDoesNotParse('start =/*/**/*/"abcd"'); }); -/* Canonical eol is "\n". */ -test("parses eol", function() { - parserParses('start =\n"abcd"', simpleGrammar); - parserParses('start =\r\n"abcd"', simpleGrammar); - parserParses('start =\r"abcd"', simpleGrammar); - parserParses('start =\u2028"abcd"', simpleGrammar); - parserParses('start =\u2029"abcd"', simpleGrammar); -}); - })();