diff options
| author | Pedro Castro <aspeddro@gmail.com> | 2022-01-29 10:36:50 -0300 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-01-29 15:25:56 +0100 |
| commit | 3606f8efbb6d02f78336965ae5c59614e39c9ebf (patch) | |
| tree | 7da0d472453b9226d3ea1f4638b4ca4f25f23e93 | |
| parent | indents(r): add tests runner (diff) | |
| download | nvim-treesitter-3606f8efbb6d02f78336965ae5c59614e39c9ebf.tar nvim-treesitter-3606f8efbb6d02f78336965ae5c59614e39c9ebf.tar.gz nvim-treesitter-3606f8efbb6d02f78336965ae5c59614e39c9ebf.tar.bz2 nvim-treesitter-3606f8efbb6d02f78336965ae5c59614e39c9ebf.tar.lz nvim-treesitter-3606f8efbb6d02f78336965ae5c59614e39c9ebf.tar.xz nvim-treesitter-3606f8efbb6d02f78336965ae5c59614e39c9ebf.tar.zst nvim-treesitter-3606f8efbb6d02f78336965ae5c59614e39c9ebf.zip | |
indents(r): add pipe test
| -rw-r--r-- | tests/indent/r/pipe.R | 7 | ||||
| -rw-r--r-- | tests/indent/r_spec.lua | 9 |
2 files changed, 15 insertions, 1 deletions
diff --git a/tests/indent/r/pipe.R b/tests/indent/r/pipe.R new file mode 100644 index 000000000..2eef84218 --- /dev/null +++ b/tests/indent/r/pipe.R @@ -0,0 +1,7 @@ +mtcars |> + head( + n = 6L + ) |> + subset( + cyl > 3 + ) diff --git a/tests/indent/r_spec.lua b/tests/indent/r_spec.lua index 1bf6a2b50..20454df7c 100644 --- a/tests/indent/r_spec.lua +++ b/tests/indent/r_spec.lua @@ -1,4 +1,5 @@ local Runner = require("tests.indent.common").Runner +local XFAIL = require("tests.indent.common").XFAIL local run = Runner:new(it, "tests/indent/r", { tabstop = 2, @@ -9,7 +10,11 @@ local run = Runner:new(it, "tests/indent/r", { describe("indent R:", function() describe("whole file:", function() - run:whole_file "." + run:whole_file(".", { + expected_failures = { + "r/pipe.R", + }, + }) end) describe("new line:", function() @@ -30,6 +35,8 @@ describe("indent R:", function() run:new_line("loop.R", { on_line = 8, text = "x <- x + 1", indent = 2 }) run:new_line("loop.R", { on_line = 14, text = "print('lol')", indent = 4 }) + run:new_line("pipe.R", { on_line = 1, text = "head(n = 10L) |>", indent = 2 }, "expected failure", XFAIL) + run:new_line("aligned_indent.R", { on_line = 1, text = "z,", indent = 17 }) end) end) |
