aboutsummaryrefslogtreecommitdiffstats
path: root/tests/indent
diff options
context:
space:
mode:
authorAbhishek Singh <abhisheksingh0x558@icloud.com>2024-11-05 19:55:42 +0530
committerGitHub <noreply@github.com>2024-11-05 15:25:42 +0100
commit604aa5a7c8cf1fd0c4ad667a0cc7fb8aaf0be33e (patch)
treebe2467c93f6297b2f2b22111af974ffed030d125 /tests/indent
parentbot(lockfile): update dhall, printf, regex, ziggy, ziggy_schema (diff)
downloadnvim-treesitter-604aa5a7c8cf1fd0c4ad667a0cc7fb8aaf0be33e.tar
nvim-treesitter-604aa5a7c8cf1fd0c4ad667a0cc7fb8aaf0be33e.tar.gz
nvim-treesitter-604aa5a7c8cf1fd0c4ad667a0cc7fb8aaf0be33e.tar.bz2
nvim-treesitter-604aa5a7c8cf1fd0c4ad667a0cc7fb8aaf0be33e.tar.lz
nvim-treesitter-604aa5a7c8cf1fd0c4ad667a0cc7fb8aaf0be33e.tar.xz
nvim-treesitter-604aa5a7c8cf1fd0c4ad667a0cc7fb8aaf0be33e.tar.zst
nvim-treesitter-604aa5a7c8cf1fd0c4ad667a0cc7fb8aaf0be33e.zip
feat(nu): add parser and queries (#7267)
Diffstat (limited to 'tests/indent')
-rw-r--r--tests/indent/nu/closure.nu6
-rw-r--r--tests/indent/nu/for.nu3
-rw-r--r--tests/indent/nu/if_else.nu5
-rw-r--r--tests/indent/nu/list.nu7
-rw-r--r--tests/indent/nu/record.nu4
-rw-r--r--tests/indent/nu/table.nu9
-rw-r--r--tests/indent/nu_spec.lua17
7 files changed, 51 insertions, 0 deletions
diff --git a/tests/indent/nu/closure.nu b/tests/indent/nu/closure.nu
new file mode 100644
index 000000000..ef6301e4a
--- /dev/null
+++ b/tests/indent/nu/closure.nu
@@ -0,0 +1,6 @@
+do { |x, y|
+ print ($x + $y);
+ print ($x - $y);
+ print ($x * $y);
+ print ($x / $y);
+}
diff --git a/tests/indent/nu/for.nu b/tests/indent/nu/for.nu
new file mode 100644
index 000000000..87dfd5f3d
--- /dev/null
+++ b/tests/indent/nu/for.nu
@@ -0,0 +1,3 @@
+for x in 1..3 {
+ print ($x * $x)
+}
diff --git a/tests/indent/nu/if_else.nu b/tests/indent/nu/if_else.nu
new file mode 100644
index 000000000..92b105737
--- /dev/null
+++ b/tests/indent/nu/if_else.nu
@@ -0,0 +1,5 @@
+if true {
+ true
+} else {
+ false
+}
diff --git a/tests/indent/nu/list.nu b/tests/indent/nu/list.nu
new file mode 100644
index 000000000..47b6b913c
--- /dev/null
+++ b/tests/indent/nu/list.nu
@@ -0,0 +1,7 @@
+let my_list = [
+ foo
+ bar
+ baz
+ qux
+ quux
+]
diff --git a/tests/indent/nu/record.nu b/tests/indent/nu/record.nu
new file mode 100644
index 000000000..cf119c6e9
--- /dev/null
+++ b/tests/indent/nu/record.nu
@@ -0,0 +1,4 @@
+let my_record = {
+ foo: "bar"
+ bar: 1
+}
diff --git a/tests/indent/nu/table.nu b/tests/indent/nu/table.nu
new file mode 100644
index 000000000..ffdf30cac
--- /dev/null
+++ b/tests/indent/nu/table.nu
@@ -0,0 +1,9 @@
+let my_table = [
+ [a b];
+ [1 2]
+ [3 4]
+ [5 6]
+ [7 8]
+ [9 10]
+ [11 12]
+]
diff --git a/tests/indent/nu_spec.lua b/tests/indent/nu_spec.lua
new file mode 100644
index 000000000..37c02ebea
--- /dev/null
+++ b/tests/indent/nu_spec.lua
@@ -0,0 +1,17 @@
+local Runner = require("tests.indent.common").Runner
+--local XFAIL = require("tests.indent.common").XFAIL
+
+local run = Runner:new(it, "tests/indent/nu", {
+ tabstop = 2,
+ shiftwidth = 2,
+ softtabstop = -1,
+ expandtab = true,
+})
+
+describe("indent Nu:", function()
+ describe("whole file:", function()
+ run:whole_file(".", {
+ expected_failures = {},
+ })
+ end)
+end)