Fix stupid mistakes in metagrammar-test.js

The mistakes weren't caught because the first one introduces a syntax
error, causing the whole test suite not to load. Unfortunately, QUnit
didn't complain so I missed this.

The real commit these changes belong to is
33a1a7c1e9.
redux
David Majda 15 years ago
parent d1fc16c373
commit 9bf86b89a6

@ -345,13 +345,13 @@ test("parses class", function() {
classGrammar(false, [["a", "d"], ["e", "h"], ["i", "l"]], "[a-de-hi-l]") classGrammar(false, [["a", "d"], ["e", "h"], ["i", "l"]], "[a-de-hi-l]")
); );
grammarParserParses("start: [a-d]\n", classGrammar(false, [["a", "d"]], "[a-d"])); grammarParserParses("start: [a-d]\n", classGrammar(false, [["a", "d"]], "[a-d]"));
}); });
/* Canonical classCharacterRange is "a-d". */ /* Canonical classCharacterRange is "a-d". */
test("parses classCharacterRange", function() { test("parses classCharacterRange", function() {
grammarParserParses("start: [a-d]", classGrammar(false, [["a", "d"]], "[a-d]")); grammarParserParses("start: [a-d]", classGrammar(false, [["a", "d"]], "[a-d]"));
grammarParserParses("start: [a-a]", classGrammar(false, [["a", "a"]], "[a-d]")); grammarParserParses("start: [a-a]", classGrammar(false, [["a", "a"]], "[a-a]"));
grammarParserDoesNotParse("start: [b-a]"); grammarParserDoesNotParse("start: [b-a]");
}); });
@ -362,18 +362,18 @@ test("parses classCharacter", function() {
/* Canonical bracketDelimitedCharacter is "a". */ /* Canonical bracketDelimitedCharacter is "a". */
test("parses bracketDelimitedCharacter", function() { test("parses bracketDelimitedCharacter", function() {
grammarParserParses("start: [a]", classGrammar(false, ["a"])); grammarParserParses("start: [a]", classGrammar(false, ["a"], "[a]"));
grammarParserParses("start: [\\n]", classGrammar(false, ["\n"])); grammarParserParses("start: [\\n]", classGrammar(false, ["\n"], "[\\n]"));
grammarParserParses("start: [\\0]", classGrammar(false, ["\0"])); grammarParserParses("start: [\\0]", classGrammar(false, ["\0"], "[\\0]"));
grammarParserParses("start: [\\x00]", classGrammar(false, ["\0"])); grammarParserParses("start: [\\x00]", classGrammar(false, ["\0"], "[\\0]"));
grammarParserParses("start: [\\u0120]", classGrammar(false, ["\u0120"])); grammarParserParses("start: [\\u0120]", classGrammar(false, ["\u0120"], "[\u0120]"));
grammarParserParses("start: [\\\n]", classGrammar(false, ["\n"])); grammarParserParses("start: [\\\n]", classGrammar(false, ["\n"], "[\\n]"));
}); });
/* Canonical simpleBracketDelimiedCharacter is "a". */ /* Canonical simpleBracketDelimiedCharacter is "a". */
test("parses simpleBracketDelimitedCharacter", function() { test("parses simpleBracketDelimitedCharacter", function() {
grammarParserParses("start: [a]", classGrammar(false, ["a"])); grammarParserParses("start: [a]", classGrammar(false, ["a"], "[a]"));
grammarParserParses("start: [[]", classGrammar(false, ["["])); grammarParserParses("start: [[]", classGrammar(false, ["["], "[[]"));
grammarParserDoesNotParse("start: []]"); grammarParserDoesNotParse("start: []]");
grammarParserDoesNotParse("start: [\\]"); grammarParserDoesNotParse("start: [\\]");
grammarParserDoesNotParse("start: [\n]"); grammarParserDoesNotParse("start: [\n]");

Loading…
Cancel
Save