diff options
Diffstat (limited to 'tests/indent')
| -rw-r--r-- | tests/indent/sql/case.sql | 8 | ||||
| -rw-r--r-- | tests/indent/sql/compound.sql | 3 | ||||
| -rw-r--r-- | tests/indent/sql/create.sql | 4 | ||||
| -rw-r--r-- | tests/indent/sql/cte.sql | 7 | ||||
| -rw-r--r-- | tests/indent/sql/insert.sql | 5 | ||||
| -rw-r--r-- | tests/indent/sql/select.sql | 4 | ||||
| -rw-r--r-- | tests/indent/sql/subquery.sql | 9 | ||||
| -rw-r--r-- | tests/indent/sql_spec.lua | 19 |
8 files changed, 59 insertions, 0 deletions
diff --git a/tests/indent/sql/case.sql b/tests/indent/sql/case.sql new file mode 100644 index 000000000..eee85a3be --- /dev/null +++ b/tests/indent/sql/case.sql @@ -0,0 +1,8 @@ +select + case + when a = 1 then '1' + when a = 2 then '2' + when a = 3 then '3' + else '0' + end as stmt1 +from tab; diff --git a/tests/indent/sql/compound.sql b/tests/indent/sql/compound.sql new file mode 100644 index 000000000..e645c6efb --- /dev/null +++ b/tests/indent/sql/compound.sql @@ -0,0 +1,3 @@ +begin + create table foo (bar int); +end; diff --git a/tests/indent/sql/create.sql b/tests/indent/sql/create.sql new file mode 100644 index 000000000..977388452 --- /dev/null +++ b/tests/indent/sql/create.sql @@ -0,0 +1,4 @@ +create table my_table ( + id bigint, + date date +); diff --git a/tests/indent/sql/cte.sql b/tests/indent/sql/cte.sql new file mode 100644 index 000000000..55426ccc3 --- /dev/null +++ b/tests/indent/sql/cte.sql @@ -0,0 +1,7 @@ +with data as ( + select + a, + b + from tab +) +select * from data; diff --git a/tests/indent/sql/insert.sql b/tests/indent/sql/insert.sql new file mode 100644 index 000000000..36fa7c093 --- /dev/null +++ b/tests/indent/sql/insert.sql @@ -0,0 +1,5 @@ +insert into mytable + (column1, column2) +values + ('john', 123), + ('jane', 124); diff --git a/tests/indent/sql/select.sql b/tests/indent/sql/select.sql new file mode 100644 index 000000000..85f0cc5b7 --- /dev/null +++ b/tests/indent/sql/select.sql @@ -0,0 +1,4 @@ +select + a, + b +from tab; diff --git a/tests/indent/sql/subquery.sql b/tests/indent/sql/subquery.sql new file mode 100644 index 000000000..a559d7e5b --- /dev/null +++ b/tests/indent/sql/subquery.sql @@ -0,0 +1,9 @@ +select + id +from foo +where id < ( + select + id + from bar + limit 1 +); diff --git a/tests/indent/sql_spec.lua b/tests/indent/sql_spec.lua new file mode 100644 index 000000000..2fdfc9b1b --- /dev/null +++ b/tests/indent/sql_spec.lua @@ -0,0 +1,19 @@ +local Runner = require("tests.indent.common").Runner +--local XFAIL = require("tests.indent.common").XFAIL + +local run = Runner:new(it, "tests/indent/sql", { + tabstop = 4, + shiftwidth = 4, + softtabstop = 0, + expandtab = true, +}) + +describe("indent SQL:", function() + describe("whole file:", function() + run:whole_file(".", { + expected_failures = {}, + }) + end) + + describe("new line:", function() end) +end) |
