From 0e384b31f49bfc8b466939f1d1b4b88d4cb78083 Mon Sep 17 00:00:00 2001 From: David Majda Date: Fri, 20 Apr 2012 19:01:12 +0200 Subject: [PATCH] Jasmine: Convert tests of parser's "doubleQuotedCharacter" 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 265d53a..b6f1a21 100644 --- a/spec/parser.spec.js +++ b/spec/parser.spec.js @@ -115,6 +115,16 @@ describe("PEG.js grammar parser", function() { }); }); + /* Canonical doubleQuotedCharacter is "a". */ + it("parses doubleQuotedCharacter", function() { + expect('start = "a"' ).toParseAs(literalGrammar("a")); + expect('start = "\\n"' ).toParseAs(literalGrammar("\n")); + expect('start = "\\0"' ).toParseAs(literalGrammar("\x00")); + expect('start = "\\xFF"' ).toParseAs(literalGrammar("\xFF")); + expect('start = "\\uFFFF"').toParseAs(literalGrammar("\uFFFF")); + expect('start = "\\\n"' ).toParseAs(literalGrammar("\n")); + }); + /* Canonical simpleDoubleQuotedCharacter is "a". */ it("parses simpleDoubleQuotedCharacter", function() { expect('start = "a"').toParseAs(literalGrammar("a")); diff --git a/test/parser-test.js b/test/parser-test.js index a893b50..4e0977b 100644 --- a/test/parser-test.js +++ b/test/parser-test.js @@ -362,14 +362,4 @@ test("parses doubleQuotedString", function() { parserParses('start = "abc"', literalGrammar("abc")); }); -/* Canonical doubleQuotedCharacter is "a". */ -test("parses doubleQuotedCharacter", function() { - parserParses('start = "a"', literalGrammar("a")); - parserParses('start = "\\n"', literalGrammar("\n")); - parserParses('start = "\\0"', literalGrammar("\x00")); - parserParses('start = "\\x00"', literalGrammar("\x00")); - parserParses('start = "\\u0120"', literalGrammar("\u0120")); - parserParses('start = "\\\n"', literalGrammar("\n")); -}); - })();