Skip to content

Commit d4601b9

Browse files
azizkprincemaple
authored andcommitted
Tests: check for quick fix due to comma; checks for changes in SQL.
1 parent 9c45f8b commit d4601b9

File tree

2 files changed

+39
-10
lines changed

2 files changed

+39
-10
lines changed

tests/syntax_test_function_calls.ex

+7
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,13 @@ x ++ y; x++y; x++y
398398
# ^ punctuation.section.arguments.begin
399399
#^^^^^^ variable.function
400400

401+
if a == nil, do: b
402+
# ^ punctuation.section.arguments.end
403+
# ^ punctuation.separator.arguments
404+
# ^^^ constant.language
405+
# ^^ keyword.operator.comparison
406+
# ^ punctuation.section.arguments.begin
407+
401408
case A.func do
402409
# ^^^^ variable.function
403410
end

tests/syntax_test_sql_fragments.ex

+32-10
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fragment(
7171
# ^ punctuation.separator.arguments
7272
# ^^^^^^^^^^^^^^^^^^^^ comment.line.double-dash.sql
7373
# ^ constant.other.placeholder.elixir
74-
# ^^^^^^^^^^ source.ex.sql support.function.psql
74+
# ^^^^^^^^^^ source.ex.sql variable.function.sql
7575
# ^^ keyword.operator.jsonb.psql
7676
# ^ constant.other.placeholder.elixir
7777
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.ex.sql
@@ -83,7 +83,7 @@ fragment(
8383

8484
fragment("""
8585
jsonb_to_tsvector('simple', content, '["string", "numeric"]')
86-
# ^^^^^^^^^^^^^^^^^ support.function.psql
86+
# ^^^^^^^^^^^^^^^^^ variable.function.sql
8787
""")
8888

8989
fragment("""\
@@ -104,11 +104,11 @@ fragment(
104104
# ^ punctuation.separator.arguments
105105
# ^ punctuation.section.arguments.end
106106
# ^ constant.other.placeholder.elixir
107-
# ^^^^^^^^ support.function.psql
107+
# ^^^^^^^^ variable.function.sql
108108
# ^^^^^^^^^^^ meta.string.elixir source.ex.sql
109109
# ^^^^^^^^^ meta.string.elixir meta.interpolation.elixir
110110
# ^^ keyword.operator.psql
111-
# ^^^^^^^^^^^^^^^^^^^^^^^^ support.function.psql
111+
# ^^^^^^^^^^^^^^^^^^^^^^^^ variable.function.sql
112112
# ^ variable.language.wildcard.asterisk.sql
113113
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.elixir source.ex.sql
114114
# ^ punctuation.section.arguments.begin
@@ -183,7 +183,21 @@ fragment(
183183
# ^ punctuation.section.arguments.end
184184
#^^^ punctuation.definition.string.end
185185

186-
# All possible keywords. See: https://www.postgresql.org/docs/current/sql-keywords-appendix.html
186+
sql("""
187+
1IN(.1,0.1,1E10,1E+10,1e-1,1e+1,0001,1)
188+
# ^^^^ constant.numeric.sql
189+
# ^^^^ constant.numeric.sql
190+
# ^^^^ constant.numeric.sql
191+
# ^^^^ constant.numeric.sql
192+
# ^^^^ constant.numeric.sql
193+
# ^^^ constant.numeric.sql
194+
# ^^ constant.numeric.sql
195+
# ^^ keyword.other.sql
196+
# ^ constant.numeric.sql
197+
""")
198+
199+
# All possible keywords or scalar variables.
200+
# See: https://www.postgresql.org/docs/current/sql-keywords-appendix.html
187201
sql("""
188202
ALL; AND; ANY; ARRAY; AS; ASYMMETRIC; AUTHORIZATION; BINARY; BOTH;
189203
# ^^^^ keyword.other.sql
@@ -196,11 +210,19 @@ fragment(
196210
# ^^^ keyword.operator.logical.sql
197211
# ^^^ keyword.other.sql
198212
CASE; CAST; CHECK; COLLATE; COLUMN; CONSTRAINT; CREATE; CROSS;
213+
# ^^^^^ keyword.other.sql
214+
# ^^^^^^ keyword.other.sql
215+
# ^^^^^^^^^^ storage.modifier.sql
216+
# ^^^^^^ keyword.other.sql
217+
# ^^^^^^^ keyword.other.sql
218+
# ^^^^^ storage.modifier.sql
219+
# ^^^^ keyword.other.sql
220+
# ^^^^ keyword.other.DML.sql
199221
CURRENT_CATALOG; CURRENT_DATE; CURRENT_ROLE; CURRENT_SCHEMA;
200-
# ^^^^^^^^^^^^^^ support.function.sql
201-
# ^^^^^^^^^^^^ support.function.sql
222+
# ^^^^^^^^^^^^^^ support.function.scalar.sql
223+
# ^^^^^^^^^^^^ support.function.scalar.sql
202224
# ^^^^^^^^^^^^ support.function.scalar.sql
203-
# ^^^^^^^^^^^^^^^ support.function.sql
225+
# ^^^^^^^^^^^^^^^ support.function.scalar.sql
204226
CURRENT_TIME; CURRENT_TIMESTAMP; CURRENT_USER;
205227
# ^^^^^^^^^^^^ support.function.scalar.sql
206228
# ^^^^^^^^^^^^^^^^^ support.function.scalar.sql
@@ -237,8 +259,8 @@ fragment(
237259
# ^^^^ constant.language.sql
238260
# ^^^ keyword.other.sql
239261
# ^^^^^^^ keyword.other.sql
240-
# ^^^^^^^^^^^^^^ support.function.sql
241-
# ^^^^^^^^^ support.function.sql
262+
# ^^^^^^^^^^^^^^ support.function.scalar.sql
263+
# ^^^^^^^^^ support.function.scalar.sql
242264
# ^^^^ keyword.operator.logical.sql
243265
# ^^^^ keyword.other.sql
244266
ORDER; OUTER; OVERLAPS; PRIMARY; REFERENCES; RIGHT; SELECT; SESSION_USER; SIMILAR;

0 commit comments

Comments
 (0)