From b5ccaed491dc6ddfce26cddcfe7959ea3de7f7c7 Mon Sep 17 00:00:00 2001 From: David Majda Date: Fri, 20 Apr 2012 15:10:57 +0200 Subject: [PATCH] Jasmine: Convert tests of parser's "singleLineComment" rule --- spec/parser.spec.js | 7 +++++++ test/parser-test.js | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/parser.spec.js b/spec/parser.spec.js index 1103e3b..44703f6 100644 --- a/spec/parser.spec.js +++ b/spec/parser.spec.js @@ -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 */". it("parses multiLineComment", function() { expect('start =/**/"abcd"' ).toParseAs(trivialGrammar); diff --git a/test/parser-test.js b/test/parser-test.js index 426cdb5..fd25e10 100644 --- a/test/parser-test.js +++ b/test/parser-test.js @@ -541,12 +541,5 @@ test("parses comment", function() { parserParses('start =// comment\n"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); -}); })();