diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/indent/css/block.css | 1 | ||||
| -rw-r--r-- | tests/indent/css/closing.css | 1 | ||||
| -rw-r--r-- | tests/indent/css/next_rule.css | 3 | ||||
| -rw-r--r-- | tests/indent/css_spec.lua | 28 |
4 files changed, 33 insertions, 0 deletions
diff --git a/tests/indent/css/block.css b/tests/indent/css/block.css new file mode 100644 index 00000000..cc79c2c0 --- /dev/null +++ b/tests/indent/css/block.css @@ -0,0 +1 @@ +.testo { diff --git a/tests/indent/css/closing.css b/tests/indent/css/closing.css new file mode 100644 index 00000000..cc79c2c0 --- /dev/null +++ b/tests/indent/css/closing.css @@ -0,0 +1 @@ +.testo { diff --git a/tests/indent/css/next_rule.css b/tests/indent/css/next_rule.css new file mode 100644 index 00000000..ae18f1bd --- /dev/null +++ b/tests/indent/css/next_rule.css @@ -0,0 +1,3 @@ +.testo { + color: green; +} diff --git a/tests/indent/css_spec.lua b/tests/indent/css_spec.lua new file mode 100644 index 00000000..3d758eba --- /dev/null +++ b/tests/indent/css_spec.lua @@ -0,0 +1,28 @@ +local Runner = require("tests.indent.common").Runner +local XFAIL = require("tests.indent.common").XFAIL + +local run = Runner:new(it, "tests/indent/css", { + tabstop = 2, + shiftwidth = 2, + softtabstop = 0, + expandtab = true, +}) + +describe("indent CSS:", function() + describe("whole file:", function() + run:whole_file(".", { + expected_failures = {}, + }) + end) + + describe("new line:", function() + run:new_line("closing.css", { on_line = 1, text = "}", indent = 0 }) + run:new_line( + "block.css", + { on_line = 1, text = "color: green;", indent = 2 }, + "might fail because tree is in a broken state", + XFAIL + ) + run:new_line("next_rule.css", { on_line = 3, text = ".next {", indent = 0 }) + end) +end) |
