aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2022-02-11 23:46:51 +0100
committerKiyan <yazdani.kiyan@protonmail.com>2022-04-04 09:03:30 +0200
commitbda4b35f76a628f9212590c39255edce221bcf7b (patch)
tree67ed842ed90833dd5c1bc4146054a6f078d99073 /tests
parentChanged quotes to appease stylua (diff)
downloadnvim-treesitter-bda4b35f76a628f9212590c39255edce221bcf7b.tar
nvim-treesitter-bda4b35f76a628f9212590c39255edce221bcf7b.tar.gz
nvim-treesitter-bda4b35f76a628f9212590c39255edce221bcf7b.tar.bz2
nvim-treesitter-bda4b35f76a628f9212590c39255edce221bcf7b.tar.lz
nvim-treesitter-bda4b35f76a628f9212590c39255edce221bcf7b.tar.xz
nvim-treesitter-bda4b35f76a628f9212590c39255edce221bcf7b.tar.zst
nvim-treesitter-bda4b35f76a628f9212590c39255edce221bcf7b.zip
indents(ecma): use auto indent on (ERROR)
Fixes #2515
Diffstat (limited to 'tests')
-rw-r--r--tests/indent/ecma/issue-2515.js16
-rw-r--r--tests/indent/javascript_spec.lua4
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/indent/ecma/issue-2515.js b/tests/indent/ecma/issue-2515.js
new file mode 100644
index 000000000..a1f158603
--- /dev/null
+++ b/tests/indent/ecma/issue-2515.js
@@ -0,0 +1,16 @@
+function test() {
+ return [
+ {
+ test: "test",
+ test_one: "test",
+ },
+ {
+ test: "test",
+ test_one: "test",
+ },
+ {
+ test: "test",
+ test_one: "test",
+ },
+ ];
+}
diff --git a/tests/indent/javascript_spec.lua b/tests/indent/javascript_spec.lua
index c832a9083..855a394f2 100644
--- a/tests/indent/javascript_spec.lua
+++ b/tests/indent/javascript_spec.lua
@@ -109,5 +109,9 @@ describe("indent JavaScript:", function()
} do
run:new_line("ecma/variable.js", { on_line = info[1], text = "hello()", indent = info[2] }, info[3], info[4])
end
+
+ for _, line in ipairs { 2, 6 } do
+ run:new_line("ecma/issue-2515.js", { on_line = line, text = "{}", indent = 4 })
+ end
end)
end)