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

This commit is contained in:
David Majda 2012-04-20 14:27:20 +02:00
parent a46b9c197b
commit b4cffee9d4
2 changed files with 8 additions and 8 deletions

View file

@ -45,6 +45,14 @@ describe("PEG.js grammar parser", function() {
});
});
/* Canonical eolChar is "\n". */
it("parses eolChar", function() {
expect('start =\n"abcd"' ).toParseAs(trivialGrammar);
expect('start =\r"abcd"' ).toParseAs(trivialGrammar);
expect('start =\u2028"abcd"').toParseAs(trivialGrammar);
expect('start =\u2029"abcd"').toParseAs(trivialGrammar);
});
/* Canonical whitespace is " ". */
it("parses whitespace", function() {
expect('start =\t"abcd"' ).toParseAs(trivialGrammar);

View file

@ -572,12 +572,4 @@ test("parses eol", function() {
parserParses('start =\u2029"abcd"', simpleGrammar);
});
/* Canonical eolChar is "\n". */
test("parses eolChar", function() {
parserParses('start =\n"abcd"', simpleGrammar);
parserParses('start =\r"abcd"', simpleGrammar);
parserParses('start =\u2028"abcd"', simpleGrammar);
parserParses('start =\u2029"abcd"', simpleGrammar);
});
})();