From 57bbcd71e516f2a7b68af01c3021bcffbc00168a Mon Sep 17 00:00:00 2001 From: David Majda Date: Fri, 20 Apr 2012 19:54:47 +0200 Subject: [PATCH] Jasmine: Convert tests of parser's "action" rule --- spec/parser.spec.js | 7 +++++++ test/parser-test.js | 5 ----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/spec/parser.spec.js b/spec/parser.spec.js index c52bfed..1afd71d 100644 --- a/spec/parser.spec.js +++ b/spec/parser.spec.js @@ -134,6 +134,13 @@ describe("PEG.js grammar parser", function() { }); }); + /* Canonical action is "{ code }". */ + it("parses action", function() { + expect('start = "abcd" { code }').toParseAs(actionGrammar(" code ")); + + expect('start = "abcd" { code }\n').toParseAs(actionGrammar(" code ")); + }); + /* Canonical braced is "{ code }". */ it("parses braced", function() { expect('start = "abcd" {}' ).toParseAs(actionGrammar("")); diff --git a/test/parser-test.js b/test/parser-test.js index abc8511..9642ef9 100644 --- a/test/parser-test.js +++ b/test/parser-test.js @@ -302,9 +302,4 @@ test("parses primary", function() { parserParses('start = ("abcd")', literalGrammar("abcd")); }); -/* Canonical action is "{ code }". */ -test("parses action", function() { - parserParses('start = "a" { code }', actionGrammar(" code ")); -}); - })();