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

This commit is contained in:
David Majda 2012-04-20 14:29:34 +02:00
parent b4cffee9d4
commit 328edf667c
2 changed files with 9 additions and 9 deletions

View file

@ -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);

View file

@ -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);
});
})();