mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 11:20:07 -04:00
test(indents/yaml): add tests
This commit is contained in:
parent
8bd07c88b6
commit
589d18ab68
3 changed files with 24 additions and 0 deletions
2
tests/indent/yaml/autoindent-mapping-pair.yaml
Normal file
2
tests/indent/yaml/autoindent-mapping-pair.yaml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
- key1: value1
|
||||||
|
key2: value2
|
||||||
2
tests/indent/yaml/indent-sequence-items.yaml
Normal file
2
tests/indent/yaml/indent-sequence-items.yaml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
- key1: value1
|
||||||
|
key2: value2
|
||||||
20
tests/indent/yaml_spec.lua
Normal file
20
tests/indent/yaml_spec.lua
Normal file
|
|
@ -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)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue