diff --git a/tests/indent/yaml/autoindent-mapping-pair.yaml b/tests/indent/yaml/autoindent-mapping-pair.yaml new file mode 100644 index 000000000..8dadeee47 --- /dev/null +++ b/tests/indent/yaml/autoindent-mapping-pair.yaml @@ -0,0 +1,2 @@ +- key1: value1 + key2: value2 diff --git a/tests/indent/yaml/indent-sequence-items.yaml b/tests/indent/yaml/indent-sequence-items.yaml new file mode 100644 index 000000000..8dadeee47 --- /dev/null +++ b/tests/indent/yaml/indent-sequence-items.yaml @@ -0,0 +1,2 @@ +- key1: value1 + key2: value2 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)