Jasmine: Convert tests of parser's "eol" rule
This commit is contained in:
parent
b4cffee9d4
commit
328edf667c
|
@ -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". */
|
/* Canonical eolChar is "\n". */
|
||||||
it("parses eolChar", function() {
|
it("parses eolChar", function() {
|
||||||
expect('start =\n"abcd"' ).toParseAs(trivialGrammar);
|
expect('start =\n"abcd"' ).toParseAs(trivialGrammar);
|
||||||
|
|
|
@ -563,13 +563,4 @@ test("parses multiLineComment", function() {
|
||||||
parserDoesNotParse('start =/*/**/*/"abcd"');
|
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);
|
|
||||||
});
|
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in a new issue