diff --git a/test/corpus/watcom/protected-text-control-words.expected.sql b/test/corpus/watcom/protected-text-control-words.expected.sql new file mode 100644 index 0000000..26b1c90 --- /dev/null +++ b/test/corpus/watcom/protected-text-control-words.expected.sql @@ -0,0 +1,13 @@ +CREATE PROCEDURE dbo.protected_text_control_words() +BEGIN + -- if then else endif should stay lower-case in a comment + SELECT CASE + WHEN MESSAGE = 'if then else endif' + THEN 'select from where' + ELSE "else" + END AS RESULT + FROM dbo.audit_log + WHERE note = 'begin end if' + AND [order by] IS NOT NULL; + /* order by where select should stay lower-case in block comment */ +END; diff --git a/test/corpus/watcom/protected-text-control-words.input.sql b/test/corpus/watcom/protected-text-control-words.input.sql new file mode 100644 index 0000000..f60dced --- /dev/null +++ b/test/corpus/watcom/protected-text-control-words.input.sql @@ -0,0 +1,8 @@ +create procedure dbo.protected_text_control_words() +begin +-- if then else endif should stay lower-case in a comment +select case when message = 'if then else endif' then 'select from where' else "else" end as result +from dbo.audit_log +where note = 'begin end if' and [order by] is not null; +/* order by where select should stay lower-case in block comment */ +end; diff --git a/test/corpus/watcom/protected-text-query-keywords.expected.sql b/test/corpus/watcom/protected-text-query-keywords.expected.sql new file mode 100644 index 0000000..cabdab1 --- /dev/null +++ b/test/corpus/watcom/protected-text-query-keywords.expected.sql @@ -0,0 +1,8 @@ +CREATE PROCEDURE dbo.protected_text_query_keywords() +BEGIN + SELECT "from", [where], 'select from where order by' AS literal_value, description + FROM dbo.keyword_notes + WHERE "from" = 'order by' + AND [where] LIKE '%select%' -- group by should stay lower-case in comment + ORDER BY "from", [where]; +END; diff --git a/test/corpus/watcom/protected-text-query-keywords.input.sql b/test/corpus/watcom/protected-text-query-keywords.input.sql new file mode 100644 index 0000000..26635a5 --- /dev/null +++ b/test/corpus/watcom/protected-text-query-keywords.input.sql @@ -0,0 +1,7 @@ +create procedure dbo.protected_text_query_keywords() +begin +select "from", [where], 'select from where order by' as literal_value, description +from dbo.keyword_notes +where "from" = 'order by' and [where] like '%select%' -- group by should stay lower-case in comment +order by "from", [where]; +end;