From d29a753b8d20f91a1f0344b92b08239985ebe593 Mon Sep 17 00:00:00 2001 From: David Majda Date: Fri, 20 Apr 2012 16:45:57 +0200 Subject: [PATCH] Jasmine: Convert tests of parser's "classCharacter" rule --- spec/parser.spec.js | 8 ++++++++ test/parser-test.js | 5 ----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/spec/parser.spec.js b/spec/parser.spec.js index fa1e024..80122d3 100644 --- a/spec/parser.spec.js +++ b/spec/parser.spec.js @@ -86,6 +86,14 @@ describe("PEG.js grammar parser", function() { }); }); + /* Canonical classCharacter is "a". */ + it("parses classCharacter", function() { + expect('start = [a]').toParseAs(classGrammar(["a"], "[a]")); + + /* This test demonstrates that |rawText| is not really "raw". */ + expect('start = [\u0080]').toParseAs(classGrammar(["\x80"], "[\\x80]")); + }); + /* Canonical bracketDelimitedCharacter is "a". */ it("parses bracketDelimitedCharacter", function() { expect('start = [a]' ).toParseAs(classGrammar(["a"], "[a]")); diff --git a/test/parser-test.js b/test/parser-test.js index 2c290df..9108618 100644 --- a/test/parser-test.js +++ b/test/parser-test.js @@ -442,9 +442,4 @@ test("parses classCharacterRange", function() { ); }); -/* Canonical classCharacter is "a". */ -test("parses classCharacter", function() { - parserParses("start = [a]", classGrammar(false, ["a"], "[a]")); -}); - })();