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

This commit is contained in:
David Majda 2012-04-20 15:17:04 +02:00
parent fadaef84dd
commit 3bc61c4c50
2 changed files with 9 additions and 9 deletions

View file

@ -68,6 +68,15 @@ describe("PEG.js grammar parser", function() {
});
});
/* Canonical __ is "\n". */
it("parses __", function() {
expect('start ="abcd"' ).toParseAs(trivialGrammar);
expect('start = "abcd"' ).toParseAs(trivialGrammar);
expect('start =\n"abcd"' ).toParseAs(trivialGrammar);
expect('start =/* comment */"abcd"').toParseAs(trivialGrammar);
expect('start = "abcd"' ).toParseAs(trivialGrammar);
});
// Canonical comment is "/* comment */".
it("parses comment", function() {
expect('start =// comment\n"abcd"' ).toParseAs(trivialGrammar);

View file

@ -525,15 +525,6 @@ test("parses eolEscapeSequence", function() {
parserParses('start = "\\\u2029"', literalGrammar("\u2029"));
});
/* Canonical __ is "\n". */
test("parses __", function() {
parserParses('start ="abcd"', simpleGrammar);
parserParses('start = "abcd"', simpleGrammar);
parserParses('start =\n"abcd"', simpleGrammar);
parserParses('start =/* comment */"abcd"', simpleGrammar);
parserParses('start = "abcd"', simpleGrammar);
});
/* Trivial character class rules are not tested. */
})();