aboutsummaryrefslogtreecommitdiffstats
path: root/tests/indent/yaml_spec.lua
diff options
context:
space:
mode:
authorPhelipe Teles <phelipe_teles@hotmail.com>2022-06-06 18:23:45 -0300
committerStephan Seitz <stephan.seitz@fau.de>2022-06-14 22:37:52 +0200
commit589d18ab68298fead08d49072cc94e501d9b64a8 (patch)
treebd7a979c95fd76668bb7d9793d2c4d46e0ed9cae /tests/indent/yaml_spec.lua
parentfix(indents/yaml): only indent mapping pair if value is a block (diff)
downloadnvim-treesitter-589d18ab68298fead08d49072cc94e501d9b64a8.tar
nvim-treesitter-589d18ab68298fead08d49072cc94e501d9b64a8.tar.gz
nvim-treesitter-589d18ab68298fead08d49072cc94e501d9b64a8.tar.bz2
nvim-treesitter-589d18ab68298fead08d49072cc94e501d9b64a8.tar.lz
nvim-treesitter-589d18ab68298fead08d49072cc94e501d9b64a8.tar.xz
nvim-treesitter-589d18ab68298fead08d49072cc94e501d9b64a8.tar.zst
nvim-treesitter-589d18ab68298fead08d49072cc94e501d9b64a8.zip
test(indents/yaml): add tests
Diffstat (limited to 'tests/indent/yaml_spec.lua')
-rw-r--r--tests/indent/yaml_spec.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/indent/yaml_spec.lua b/tests/indent/yaml_spec.lua
new file mode 100644
index 000000000..91c60c227
--- /dev/null
+++ b/tests/indent/yaml_spec.lua
@@ -0,0 +1,20 @@
+local Runner = require("tests.indent.common").Runner
+--local XFAIL = require("tests.indent.common").XFAIL
+
+local run = Runner:new(it, "tests/indent/yaml", {
+ shiftwidth = 2,
+ expandtab = true,
+})
+
+describe("indent YAML:", function()
+ describe("whole file:", function()
+ run:whole_file(".", {
+ expected_failures = {},
+ })
+ end)
+
+ describe("new line:", function()
+ run:new_line("indent-sequence-items.yaml", { on_line = 2, text = "key3: value3", indent = 2 })
+ run:new_line("autoindent-mapping-pair.yaml", { on_line = 1, text = "key3: value3", indent = 2 })
+ end)
+end)