aboutsummaryrefslogtreecommitdiffstats
path: root/lua/tests/indent/c_spec.lua
diff options
context:
space:
mode:
authorJędrzej Boczar <yendreij@gmail.com>2021-03-13 23:51:57 +0100
committerKiyan <yazdani.kiyan@protonmail.com>2021-04-23 21:21:38 +0200
commit4454459fb2ce64caaf1d0e32472ad7dcdbf3e436 (patch)
treeb8a48ceb3132e67a21698f8c1584c94b8f248278 /lua/tests/indent/c_spec.lua
parentInitial sketch of automated indent tests (diff)
downloadnvim-treesitter-4454459fb2ce64caaf1d0e32472ad7dcdbf3e436.tar
nvim-treesitter-4454459fb2ce64caaf1d0e32472ad7dcdbf3e436.tar.gz
nvim-treesitter-4454459fb2ce64caaf1d0e32472ad7dcdbf3e436.tar.bz2
nvim-treesitter-4454459fb2ce64caaf1d0e32472ad7dcdbf3e436.tar.lz
nvim-treesitter-4454459fb2ce64caaf1d0e32472ad7dcdbf3e436.tar.xz
nvim-treesitter-4454459fb2ce64caaf1d0e32472ad7dcdbf3e436.tar.zst
nvim-treesitter-4454459fb2ce64caaf1d0e32472ad7dcdbf3e436.zip
tests/indent: add basic examples for C and Rust
Diffstat (limited to 'lua/tests/indent/c_spec.lua')
-rw-r--r--lua/tests/indent/c_spec.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/lua/tests/indent/c_spec.lua b/lua/tests/indent/c_spec.lua
new file mode 100644
index 000000000..5176312b6
--- /dev/null
+++ b/lua/tests/indent/c_spec.lua
@@ -0,0 +1,18 @@
+local whole_file = require('nvim-treesitter.test_utils').indent_whole_file
+
+describe('indent C', function()
+ local files = {
+ 'basic.c',
+ 'no_braces.c',
+ }
+ for _, file in ipairs(files) do
+ it(file, function()
+ whole_file('lua/tests/indent/c/' .. file, {
+ tabstop = 4,
+ shiftwidth = 4,
+ softtabstop = 0,
+ expandtab = true,
+ })
+ end)
+ end
+end)