test(indents/yaml): add tests

This commit is contained in:
Phelipe Teles 2022-06-06 18:23:45 -03:00 committed by Stephan Seitz
parent 8bd07c88b6
commit 589d18ab68
3 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,2 @@
- key1: value1
key2: value2

View file

@ -0,0 +1,2 @@
- key1: value1
key2: value2

View 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)