Skip to content

Commit

Permalink
fix: spell check (DTStack#337)
Browse files Browse the repository at this point in the history
Co-authored-by: liuyi <[email protected]>
  • Loading branch information
liuxy0551 and liuyi committed Nov 14, 2024
1 parent 5acdea9 commit c8e6352
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 53 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ All notable changes to this project will be documented in this file. See [standa

### Features

* add toMatchUnorderedArrary matcher and apply it ([#271](https://github.com/DTStack/dt-sql-parser/issues/271)) ([a05f099](https://github.com/DTStack/dt-sql-parser/commit/a05f099aa1ad555c408bc2018240fb4611ec09b8))
* add toMatchUnorderedArray matcher and apply it ([#271](https://github.com/DTStack/dt-sql-parser/issues/271)) ([a05f099](https://github.com/DTStack/dt-sql-parser/commit/a05f099aa1ad555c408bc2018240fb4611ec09b8))
* collect entity ([#265](https://github.com/DTStack/dt-sql-parser/issues/265)) ([a997211](https://github.com/DTStack/dt-sql-parser/commit/a99721162be0d463b513f53bb13ada6d10168548)), closes [#256](https://github.com/DTStack/dt-sql-parser/issues/256) [#263](https://github.com/DTStack/dt-sql-parser/issues/263) [#268](https://github.com/DTStack/dt-sql-parser/issues/268)
* migrate to antlr4ng ([#267](https://github.com/DTStack/dt-sql-parser/issues/267)) ([195878d](https://github.com/DTStack/dt-sql-parser/commit/195878da9bb1ff8011b5d60c02389fa66d2bc0b8))
* **spark:** support materialized view for spark sql ([#262](https://github.com/DTStack/dt-sql-parser/issues/262)) ([5ce89cb](https://github.com/DTStack/dt-sql-parser/commit/5ce89cb421de18330d56e23a4ab5b658b2130a0b))
Expand Down
6 changes: 3 additions & 3 deletions test/jest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ namespace jest {
* Every item must be primitive type, like string, number, etc.
*
* @example
* expect(['a', 'b']).toMatchUnorderedArrary(['b', 'a']) // pass
* expect(['b', 'a']).toMatchUnorderedArrary(['c', 'b', 'a']) // not pass, missing item 'c'
* expect(['a', 'b']).toMatchUnorderedArray(['b', 'a']) // pass
* expect(['b', 'a']).toMatchUnorderedArray(['c', 'b', 'a']) // not pass, missing item 'c'
*/
toMatchUnorderedArrary(expected: unknown[]): R;
toMatchUnorderedArray(expected: unknown[]): R;
}
}
2 changes: 1 addition & 1 deletion test/matchers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const toMatchUnorderedArrary: jest.CustomMatcher = function (
export const toMatchUnorderedArray: jest.CustomMatcher = function (
actual: Array<unknown>,
expected: Array<unknown>
) {
Expand Down
6 changes: 3 additions & 3 deletions test/parser/flink/suggestion/tokenSuggestion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Flink SQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary(['MODULES', 'CATALOG']);
expect(suggestion).toMatchUnorderedArray(['MODULES', 'CATALOG']);
});

test('Create Statement ', () => {
Expand All @@ -32,7 +32,7 @@ describe('Flink SQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'CATALOG',
'FUNCTION',
'TEMPORARY',
Expand All @@ -52,7 +52,7 @@ describe('Flink SQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'MODULES',
'FULL',
'FUNCTIONS',
Expand Down
20 changes: 10 additions & 10 deletions test/parser/hive/suggestion/tokenSuggestion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('Hive SQL Token Suggestion', () => {
commentOtherLine(tokenSql, pos.lineNumber),
pos
)?.keywords;
expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'APPLICATION',
'GROUP',
'USER',
Expand All @@ -45,7 +45,7 @@ describe('Hive SQL Token Suggestion', () => {
commentOtherLine(tokenSql, pos.lineNumber),
pos
)?.keywords;
expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'CONNECTOR',
'APPLICATION',
'GROUP',
Expand Down Expand Up @@ -80,7 +80,7 @@ describe('Hive SQL Token Suggestion', () => {
commentOtherLine(tokenSql, pos.lineNumber),
pos
)?.keywords;
expect(suggestion).toMatchUnorderedArrary(['FROM']);
expect(suggestion).toMatchUnorderedArray(['FROM']);
});

test('After DESCRIBE', () => {
Expand All @@ -92,7 +92,7 @@ describe('Hive SQL Token Suggestion', () => {
commentOtherLine(tokenSql, pos.lineNumber),
pos
)?.keywords;
expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'EXTENDED',
'FORMATTED',
'FUNCTION',
Expand All @@ -111,7 +111,7 @@ describe('Hive SQL Token Suggestion', () => {
commentOtherLine(tokenSql, pos.lineNumber),
pos
)?.keywords;
expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'CONNECTOR',
'APPLICATION',
'GROUP',
Expand Down Expand Up @@ -141,7 +141,7 @@ describe('Hive SQL Token Suggestion', () => {
commentOtherLine(tokenSql, pos.lineNumber),
pos
)?.keywords;
expect(suggestion).toMatchUnorderedArrary(['TABLE']);
expect(suggestion).toMatchUnorderedArray(['TABLE']);
});

test('After IMPORT', () => {
Expand All @@ -153,7 +153,7 @@ describe('Hive SQL Token Suggestion', () => {
commentOtherLine(tokenSql, pos.lineNumber),
pos
)?.keywords;
expect(suggestion).toMatchUnorderedArrary(['FROM', 'TABLE', 'EXTERNAL']);
expect(suggestion).toMatchUnorderedArray(['FROM', 'TABLE', 'EXTERNAL']);
});

test('After INSERT', () => {
Expand All @@ -165,7 +165,7 @@ describe('Hive SQL Token Suggestion', () => {
commentOtherLine(tokenSql, pos.lineNumber),
pos
)?.keywords;
expect(suggestion).toMatchUnorderedArrary(['INTO', 'OVERWRITE']);
expect(suggestion).toMatchUnorderedArray(['INTO', 'OVERWRITE']);
});

test('After LOAD', () => {
Expand All @@ -177,7 +177,7 @@ describe('Hive SQL Token Suggestion', () => {
commentOtherLine(tokenSql, pos.lineNumber),
pos
)?.keywords;
expect(suggestion).toMatchUnorderedArrary(['DATA']);
expect(suggestion).toMatchUnorderedArray(['DATA']);
});

test('After SHOW', () => {
Expand All @@ -189,7 +189,7 @@ describe('Hive SQL Token Suggestion', () => {
commentOtherLine(tokenSql, pos.lineNumber),
pos
)?.keywords;
expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'CURRENT',
'ROLES',
'PRINCIPALS',
Expand Down
10 changes: 5 additions & 5 deletions test/parser/impala/suggestion/tokenSuggestion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Impala SQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary(['TABLE', 'VIEW', 'DATABASE']);
expect(suggestion).toMatchUnorderedArray(['TABLE', 'VIEW', 'DATABASE']);
});

test('After CREATE', () => {
Expand All @@ -32,7 +32,7 @@ describe('Impala SQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'TABLE',
'EXTERNAL',
'VIEW',
Expand All @@ -54,7 +54,7 @@ describe('Impala SQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'DATABASE',
'SCHEMA',
'TABLE',
Expand All @@ -77,7 +77,7 @@ describe('Impala SQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary(['INTO', 'OVERWRITE']);
expect(suggestion).toMatchUnorderedArray(['INTO', 'OVERWRITE']);
});

test('After SHOW', () => {
Expand All @@ -90,7 +90,7 @@ describe('Impala SQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'DATABASES',
'SCHEMAS',
'TABLES',
Expand Down
16 changes: 8 additions & 8 deletions test/parser/mysql/suggestion/tokenSuggestion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('MySQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'RESOURCE',
'USER',
'VIEW',
Expand Down Expand Up @@ -50,7 +50,7 @@ describe('MySQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'RESOURCE',
'USER',
'ROLE',
Expand Down Expand Up @@ -92,7 +92,7 @@ describe('MySQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary(['FROM', 'IGNORE', 'QUICK', 'LOW_PRIORITY']);
expect(suggestion).toMatchUnorderedArray(['FROM', 'IGNORE', 'QUICK', 'LOW_PRIORITY']);
});

test('After DESCRIBE', () => {
Expand All @@ -105,7 +105,7 @@ describe('MySQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'ANALYZE',
'SELECT',
'DELETE',
Expand All @@ -129,7 +129,7 @@ describe('MySQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'RESOURCE',
'USER',
'PREPARE',
Expand Down Expand Up @@ -162,7 +162,7 @@ describe('MySQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'INTO',
'IGNORE',
'DELAYED',
Expand All @@ -181,7 +181,7 @@ describe('MySQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary(['INDEX', 'XML', 'DATA']);
expect(suggestion).toMatchUnorderedArray(['INDEX', 'XML', 'DATA']);
});

test('After SHOW', () => {
Expand All @@ -194,7 +194,7 @@ describe('MySQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'REPLICAS',
'REPLICA',
'SLAVE',
Expand Down
10 changes: 5 additions & 5 deletions test/parser/postgresql/suggestion/tokenSuggestion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Postgres SQL Token Suggestion', () => {
commentOtherLine(tokenSql, pos.lineNumber),
pos
)?.keywords;
expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'TYPE',
'TEXT',
'STATISTICS',
Expand Down Expand Up @@ -66,7 +66,7 @@ describe('Postgres SQL Token Suggestion', () => {
commentOtherLine(tokenSql, pos.lineNumber),
pos
)?.keywords;
expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'RECURSIVE',
'VIEW',
'TEMPORARY',
Expand Down Expand Up @@ -126,7 +126,7 @@ describe('Postgres SQL Token Suggestion', () => {
commentOtherLine(tokenSql, pos.lineNumber),
pos
)?.keywords;
expect(suggestion).toMatchUnorderedArrary(['FROM']);
expect(suggestion).toMatchUnorderedArray(['FROM']);
});

test('After DROP', () => {
Expand All @@ -138,7 +138,7 @@ describe('Postgres SQL Token Suggestion', () => {
commentOtherLine(tokenSql, pos.lineNumber),
pos
)?.keywords;
expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'OPERATOR',
'ROUTINE',
'PROCEDURE',
Expand Down Expand Up @@ -188,6 +188,6 @@ describe('Postgres SQL Token Suggestion', () => {
commentOtherLine(tokenSql, pos.lineNumber),
pos
)?.keywords;
expect(suggestion).toMatchUnorderedArrary(['INTO']);
expect(suggestion).toMatchUnorderedArray(['INTO']);
});
});
18 changes: 9 additions & 9 deletions test/parser/spark/suggestion/tokenSuggestion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Spark SQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'TABLE',
'INDEX',
'VIEW',
Expand All @@ -40,7 +40,7 @@ describe('Spark SQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'TEMPORARY',
'INDEX',
'ROLE',
Expand All @@ -67,7 +67,7 @@ describe('Spark SQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary(['FROM']);
expect(suggestion).toMatchUnorderedArray(['FROM']);
});

test('After DESCRIBE', () => {
Expand All @@ -80,7 +80,7 @@ describe('Spark SQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'WITH',
'SELECT',
'MAP',
Expand All @@ -106,7 +106,7 @@ describe('Spark SQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'TEMPORARY',
'INDEX',
'ROLE',
Expand All @@ -130,7 +130,7 @@ describe('Spark SQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary(['OVERWRITE', 'INTO']);
expect(suggestion).toMatchUnorderedArray(['OVERWRITE', 'INTO']);
});

test('After LOAD', () => {
Expand All @@ -143,7 +143,7 @@ describe('Spark SQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary(['DATA']);
expect(suggestion).toMatchUnorderedArray(['DATA']);
});

test('After SHOW', () => {
Expand All @@ -156,7 +156,7 @@ describe('Spark SQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary([
expect(suggestion).toMatchUnorderedArray([
'LOCKS',
'INDEXES',
'TRANSACTIONS',
Expand Down Expand Up @@ -195,6 +195,6 @@ describe('Spark SQL Token Suggestion', () => {
pos
)?.keywords;

expect(suggestion).toMatchUnorderedArrary(['TABLE']);
expect(suggestion).toMatchUnorderedArray(['TABLE']);
});
});
Loading

0 comments on commit c8e6352

Please sign in to comment.