Jasmine: Convert tests of parser's "singleLineComment" rule
This commit is contained in:
parent
dac3b0d8d9
commit
b5ccaed491
|
@ -68,6 +68,13 @@ describe("PEG.js grammar parser", function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* Canonical singleLineComment is "// comment". */
|
||||||
|
it("parses singleLineComment", function() {
|
||||||
|
expect('start =//\n"abcd"' ).toParseAs(trivialGrammar);
|
||||||
|
expect('start =//a\n"abcd"' ).toParseAs(trivialGrammar);
|
||||||
|
expect('start =//aaa\n"abcd"').toParseAs(trivialGrammar);
|
||||||
|
});
|
||||||
|
|
||||||
// Canonical multiLineComment is "/* comment */".
|
// Canonical multiLineComment is "/* comment */".
|
||||||
it("parses multiLineComment", function() {
|
it("parses multiLineComment", function() {
|
||||||
expect('start =/**/"abcd"' ).toParseAs(trivialGrammar);
|
expect('start =/**/"abcd"' ).toParseAs(trivialGrammar);
|
||||||
|
|
|
@ -541,12 +541,5 @@ test("parses comment", function() {
|
||||||
parserParses('start =// comment\n"abcd"', simpleGrammar);
|
parserParses('start =// comment\n"abcd"', simpleGrammar);
|
||||||
parserParses('start =/* comment */"abcd"', simpleGrammar);
|
parserParses('start =/* comment */"abcd"', simpleGrammar);
|
||||||
});
|
});
|
||||||
/* Canonical singleLineComment is "// comment". */
|
|
||||||
test("parses singleLineComment", function() {
|
|
||||||
parserParses('start =//\n"abcd"', simpleGrammar);
|
|
||||||
parserParses('start =//a\n"abcd"', simpleGrammar);
|
|
||||||
parserParses('start =//aaa\n"abcd"', simpleGrammar);
|
|
||||||
parserParses('start = "abcd"//', simpleGrammar);
|
|
||||||
});
|
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in a new issue