aboutsummaryrefslogtreecommitdiffstats
path: root/tests/indent/smali_spec.lua
diff options
context:
space:
mode:
authorAmaan Qureshi <amaanq12@gmail.com>2023-04-24 19:12:06 -0400
committerAmaan Qureshi <amaanq12@gmail.com>2023-04-25 02:37:31 -0400
commitb39e6bd61590e429b6fd42734f1485b94335af5f (patch)
tree941510a65aa47b6456a1cfaf678a03afaeacf942 /tests/indent/smali_spec.lua
parentfeat(smali): update queries from upstream parser (diff)
downloadnvim-treesitter-b39e6bd61590e429b6fd42734f1485b94335af5f.tar
nvim-treesitter-b39e6bd61590e429b6fd42734f1485b94335af5f.tar.gz
nvim-treesitter-b39e6bd61590e429b6fd42734f1485b94335af5f.tar.bz2
nvim-treesitter-b39e6bd61590e429b6fd42734f1485b94335af5f.tar.lz
nvim-treesitter-b39e6bd61590e429b6fd42734f1485b94335af5f.tar.xz
nvim-treesitter-b39e6bd61590e429b6fd42734f1485b94335af5f.tar.zst
nvim-treesitter-b39e6bd61590e429b6fd42734f1485b94335af5f.zip
chore(smali): add tests
Diffstat (limited to 'tests/indent/smali_spec.lua')
-rw-r--r--tests/indent/smali_spec.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/indent/smali_spec.lua b/tests/indent/smali_spec.lua
new file mode 100644
index 000000000..cddc4f9d2
--- /dev/null
+++ b/tests/indent/smali_spec.lua
@@ -0,0 +1,25 @@
+local Runner = require("tests.indent.common").Runner
+
+local run = Runner:new(it, "tests/indent/smali", {
+ tabstop = 4,
+ shiftwidth = 4,
+ expandtab = false,
+})
+
+describe("indent Smali:", function()
+ describe("whole file:", function()
+ run:whole_file(".", {
+ expected_failures = {},
+ })
+ end)
+
+ describe("new line:", function()
+ run:new_line("field.smali", { on_line = 7, text = 'value1 = "test"', indent = 1 })
+ run:new_line("field.smali", { on_line = 10, text = "value2 = Lsome/enum;", indent = 2 })
+ run:new_line("array_and_switch.smali", { on_line = 43, text = "1 2 3 4 5 6 200", indent = 2 })
+ run:new_line("array_and_switch.smali", { on_line = 48, text = "Label10:", indent = 2 })
+ run:new_line("method.smali", { on_line = 7, text = ".registers 10", indent = 1 })
+ run:new_line("parameter.smali", { on_line = 20, text = ".annotation runtime Lsome/annotation;", indent = 3 })
+ run:new_line("parameter.smali", { on_line = 21, text = 'something = "some value"', indent = 3 })
+ end)
+end)