From 3bc61c4c50e2e2ccee6f6f5f739586ebb1eea7e6 Mon Sep 17 00:00:00 2001 From: David Majda Date: Fri, 20 Apr 2012 15:17:04 +0200 Subject: [PATCH] Jasmine: Convert tests of parser's "__" rule --- spec/parser.spec.js | 9 +++++++++ test/parser-test.js | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spec/parser.spec.js b/spec/parser.spec.js index 1b0ff9e..5fd6c33 100644 --- a/spec/parser.spec.js +++ b/spec/parser.spec.js @@ -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); diff --git a/test/parser-test.js b/test/parser-test.js index 8664669..cee2a80 100644 --- a/test/parser-test.js +++ b/test/parser-test.js @@ -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. */ })();