Skip to content

Commit 802a843

Browse files
committed
fix(suggestion): move SQL to fixtures
1 parent 13374e3 commit 802a843

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
SELECT * FROM aa.bb;
22

3-
USE
3+
USE
44
;
55
CREATE
66
;
7-
SHOW
8-
;
9-
CREATE TABLE IF NOT EXISTS
10-
;
7+
SHOW
8+
9+
CREATE TABLE tmp_table (col INT) WITH ('connector'='kafka');

test/parser/flink/suggestion/tokenSuggestion.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,18 +95,17 @@ describe('Flink SQL Token Suggestion', () => {
9595
});
9696

9797
test('Create Statement table properties', () => {
98-
const tokenSql = `CREATE TABLE tmp_table (col INT) WITH ('connector'='kafka');`;
9998
const scenarios = [
10099
{
101100
caretPosition: {
102-
lineNumber: 1,
101+
lineNumber: 9,
103102
column: 45,
104103
},
105104
entityContextType: EntityContextType.TABLE_PROPERTY_KEY,
106105
},
107106
{
108107
caretPosition: {
109-
lineNumber: 1,
108+
lineNumber: 9,
110109
column: 55,
111110
},
112111
entityContextType: EntityContextType.TABLE_PROPERTY_VALUE,
@@ -115,7 +114,7 @@ describe('Flink SQL Token Suggestion', () => {
115114

116115
scenarios.forEach((scenario) => {
117116
const suggestion = flink.getSuggestionAtCaretPosition(
118-
tokenSql,
117+
commentOtherLine(tokenSql, scenario.caretPosition.lineNumber),
119118
scenario.caretPosition
120119
)?.syntax;
121120

0 commit comments

Comments
 (0)