Jasmine: Convert tests of parser's "simpleDoubleQuotedCharacter" rule

redux
David Majda 12 years ago
parent fb01f48c97
commit 2f5f8d5932

@ -115,6 +115,15 @@ describe("PEG.js grammar parser", function() {
});
});
/* Canonical simpleDoubleQuotedCharacter is "a". */
it("parses simpleDoubleQuotedCharacter", function() {
expect('start = "a"').toParseAs(literalGrammar("a"));
expect('start = """' ).toFailToParse();
expect('start = "\\"').toFailToParse();
expect('start = "\n"').toFailToParse();
});
/* Canonical singleQuotedString is "'abcd'". */
it("parses singleQuotedString", function() {
expect("start = ''" ).toParseAs(literalGrammar(""));

@ -372,16 +372,4 @@ test("parses doubleQuotedCharacter", function() {
parserParses('start = "\\\n"', literalGrammar("\n"));
});
/* Canonical simpleDoubleQuotedCharacter is "a". */
test("parses simpleDoubleQuotedCharacter", function() {
parserParses('start = "a"', literalGrammar("a"));
parserParses('start = "\'"', literalGrammar("'"));
parserDoesNotParse('start = """');
parserDoesNotParse('start = "\\"');
parserDoesNotParse('start = "\n"');
parserDoesNotParse('start = "\r"');
parserDoesNotParse('start = "\u2028"');
parserDoesNotParse('start = "\u2029"');
});
})();

Loading…
Cancel
Save