Skip to content

Commit 28c5564

Browse files
Copilotzijchen
andcommitted
Fix error test position calculations for accurate error reporting
Co-authored-by: zijchen <13544267+zijchen@users.noreply.github.com>
1 parent 53a2aba commit 28c5564

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

Test/SqlDom/ParserErrorsTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4416,11 +4416,11 @@ public void CreateJsonIndexStatementErrorTest()
44164416
// Test that UNIQUE and CLUSTERED/NONCLUSTERED are not allowed with JSON indexes in TSql170
44174417
TSql170Parser parser170 = new TSql170Parser(true);
44184418
ParserTestUtils.ErrorTest(parser170, "CREATE UNIQUE JSON INDEX idx1 ON table1 (jsonColumn)",
4419-
new ParserErrorInfo(25, "SQL46010", "INDEX"));
4419+
new ParserErrorInfo(19, "SQL46010", "INDEX"));
44204420
ParserTestUtils.ErrorTest(parser170, "CREATE CLUSTERED JSON INDEX idx1 ON table1 (jsonColumn)",
4421-
new ParserErrorInfo(28, "SQL46010", "INDEX"));
4421+
new ParserErrorInfo(22, "SQL46010", "INDEX"));
44224422
ParserTestUtils.ErrorTest(parser170, "CREATE NONCLUSTERED JSON INDEX idx1 ON table1 (jsonColumn)",
4423-
new ParserErrorInfo(32, "SQL46010", "INDEX"));
4423+
new ParserErrorInfo(26, "SQL46010", "INDEX"));
44244424

44254425
// Test malformed JSON Index syntax in TSql170
44264426
// Missing column specification
@@ -4429,11 +4429,11 @@ public void CreateJsonIndexStatementErrorTest()
44294429

44304430
// Empty FOR clause
44314431
ParserTestUtils.ErrorTest(parser170, "CREATE JSON INDEX idx1 ON table1 (jsonColumn) FOR ()",
4432-
new ParserErrorInfo(55, "SQL46029"));
4432+
new ParserErrorInfo(51, "SQL46029"));
44334433

44344434
// Invalid JSON path (missing quotes)
44354435
ParserTestUtils.ErrorTest(parser170, "CREATE JSON INDEX idx1 ON table1 (jsonColumn) FOR ($.name)",
4436-
new ParserErrorInfo(55, "SQL46010", "$"));
4436+
new ParserErrorInfo(51, "SQL46010", "$"));
44374437

44384438
// Missing table name
44394439
ParserTestUtils.ErrorTest(parser170, "CREATE JSON INDEX idx1 ON (jsonColumn)",

global.json.backup

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)