aboutsummaryrefslogtreecommitdiffstats
path: root/tests/indent/sway_spec.lua
diff options
context:
space:
mode:
authorRiley Bruins <ribru17@hotmail.com>2024-11-01 13:34:02 -0700
committerChristian Clason <ch.clason+github@icloud.com>2024-11-04 08:36:41 +0100
commit8fadb18430df7025cad37f2b6b5138fe00eea545 (patch)
tree59ac3e41f3723350fca380033794b866b7066ac9 /tests/indent/sway_spec.lua
parentfix(cooklang): apply correct filetype (diff)
downloadnvim-treesitter-8fadb18430df7025cad37f2b6b5138fe00eea545.tar
nvim-treesitter-8fadb18430df7025cad37f2b6b5138fe00eea545.tar.gz
nvim-treesitter-8fadb18430df7025cad37f2b6b5138fe00eea545.tar.bz2
nvim-treesitter-8fadb18430df7025cad37f2b6b5138fe00eea545.tar.lz
nvim-treesitter-8fadb18430df7025cad37f2b6b5138fe00eea545.tar.xz
nvim-treesitter-8fadb18430df7025cad37f2b6b5138fe00eea545.tar.zst
nvim-treesitter-8fadb18430df7025cad37f2b6b5138fe00eea545.zip
feat: sway programming language
Diffstat (limited to 'tests/indent/sway_spec.lua')
-rw-r--r--tests/indent/sway_spec.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/indent/sway_spec.lua b/tests/indent/sway_spec.lua
new file mode 100644
index 000000000..d37573ae9
--- /dev/null
+++ b/tests/indent/sway_spec.lua
@@ -0,0 +1,20 @@
+local Runner = require("tests.indent.common").Runner
+
+local run = Runner:new(it, "tests/indent/sway", {
+ tabstop = 4,
+ shiftwidth = 4,
+ softtabstop = 4,
+ expandtab = true,
+})
+
+describe("indent Sway:", function()
+ describe("whole file:", function()
+ run:whole_file(".", {})
+ end)
+ describe("new line:", function()
+ run:new_line("main.sw", { on_line = 12, text = "const CONST: u32 = 2;", indent = 0 })
+ run:new_line("main.sw", { on_line = 14, text = "let hi = 5;", indent = 4 })
+ run:new_line("main.sw", { on_line = 15, text = "let hi = 5;", indent = 8 })
+ run:new_line("main.sw", { on_line = 92, text = "let hi = 5;", indent = 12 })
+ end)
+end)