From b9ae8f9561350ac24085fb0941abfc830a36b3ad Mon Sep 17 00:00:00 2001 From: David Majda Date: Fri, 20 Apr 2012 16:34:55 +0200 Subject: [PATCH] Jasmine: Convert tests of parser's "bracketDelimitedCharacter" rule --- spec/parser.spec.js | 10 ++++++++++ test/parser-test.js | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/spec/parser.spec.js b/spec/parser.spec.js index 1933f98..fa1e024 100644 --- a/spec/parser.spec.js +++ b/spec/parser.spec.js @@ -86,6 +86,16 @@ describe("PEG.js grammar parser", function() { }); }); + /* Canonical bracketDelimitedCharacter is "a". */ + it("parses bracketDelimitedCharacter", function() { + expect('start = [a]' ).toParseAs(classGrammar(["a"], "[a]")); + expect('start = [\\n]' ).toParseAs(classGrammar(["\n"], "[\\n]")); + expect('start = [\\0]' ).toParseAs(classGrammar(["\x00"], "[\\0]")); + expect('start = [\\xFF]' ).toParseAs(classGrammar(["\xFF"], "[\\xFF]")); + expect('start = [\\uFFFF]').toParseAs(classGrammar(["\uFFFF"], "[\\uFFFF]")); + expect('start = [\\\n]' ).toParseAs(classGrammar(["\n"], "[\\n]")); + }); + /* Canonical simpleBracketDelimiedCharacter is "a". */ it("parses simpleBracketDelimitedCharacter", function() { expect('start = [a]').toParseAs(classGrammar(["a"], "[a]")); diff --git a/test/parser-test.js b/test/parser-test.js index 42d61ab..2c290df 100644 --- a/test/parser-test.js +++ b/test/parser-test.js @@ -447,14 +447,4 @@ test("parses classCharacter", function() { parserParses("start = [a]", classGrammar(false, ["a"], "[a]")); }); -/* Canonical bracketDelimitedCharacter is "a". */ -test("parses bracketDelimitedCharacter", function() { - parserParses("start = [a]", classGrammar(false, ["a"], "[a]")); - parserParses("start = [\\n]", classGrammar(false, ["\n"], "[\\n]")); - parserParses("start = [\\0]", classGrammar(false, ["\x00"], "[\\0]")); - parserParses("start = [\\x00]", classGrammar(false, ["\x00"], "[\\0]")); - parserParses("start = [\\u0120]", classGrammar(false, ["\u0120"], "[\\u0120]")); - parserParses("start = [\\\n]", classGrammar(false, ["\n"], "[\\n]")); -}); - })();