From e306b58443446fb8b525a84ba03cd424c5785af2 Mon Sep 17 00:00:00 2001 From: David Majda Date: Mon, 26 Jan 2015 09:42:37 +0100 Subject: [PATCH] Behavior specs cleanup: Improve error reporting specs --- spec/behavior/generated-parser-behavior.spec.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/behavior/generated-parser-behavior.spec.js b/spec/behavior/generated-parser-behavior.spec.js index fc7a13c..e681196 100644 --- a/spec/behavior/generated-parser-behavior.spec.js +++ b/spec/behavior/generated-parser-behavior.spec.js @@ -1090,7 +1090,7 @@ describe("generated parser behavior", function() { 'start = line (nl+ line)*', 'line = digit (" "+ digit)*', 'digit = [0-9]', - 'nl = ("\\r" / "\\n" / "\\u2028" / "\\u2029")' + 'nl = [\\r\\n\\u2028\\u2029]' ].join("\n"), options); expect(parser).toFailToParse("1\n2\n\n3\n\n\n4 5 x", { @@ -1100,29 +1100,29 @@ describe("generated parser behavior", function() { }); /* Non-Unix newlines */ - expect(parser).toFailToParse("1\rx", { // Old Mac + expect(parser).toFailToParse("1\rx", { // Old Mac offset: 2, line: 2, column: 1 }); - expect(parser).toFailToParse("1\r\nx", { // Windows + expect(parser).toFailToParse("1\r\nx", { // Windows offset: 3, line: 2, column: 1 }); - expect(parser).toFailToParse("1\n\rx", { // mismatched + expect(parser).toFailToParse("1\n\rx", { // mismatched offset: 3, line: 3, column: 1 }); /* Strange newlines */ - expect(parser).toFailToParse("1\u2028x", { // line separator + expect(parser).toFailToParse("1\u2028x", { // line separator offset: 2, line: 2, column: 1 }); - expect(parser).toFailToParse("1\u2029x", { // paragraph separator + expect(parser).toFailToParse("1\u2029x", { // paragraph separator offset: 2, line: 2, column: 1