aboutsummaryrefslogtreecommitdiffstats
path: root/lua/tests/indent/cpp_spec.lua
diff options
context:
space:
mode:
authorJędrzej Boczar <yendreij@gmail.com>2021-04-17 22:47:02 +0200
committerKiyan <yazdani.kiyan@protonmail.com>2021-04-23 21:21:38 +0200
commit15f0813b6e0682e3f2c3b611610f6ef67cc87449 (patch)
tree80d795bb93249c432980164dda51f5a5267425cd /lua/tests/indent/cpp_spec.lua
parenttests/indent: refactor indent test runner and auto-discover language test files (diff)
downloadnvim-treesitter-15f0813b6e0682e3f2c3b611610f6ef67cc87449.tar
nvim-treesitter-15f0813b6e0682e3f2c3b611610f6ef67cc87449.tar.gz
nvim-treesitter-15f0813b6e0682e3f2c3b611610f6ef67cc87449.tar.bz2
nvim-treesitter-15f0813b6e0682e3f2c3b611610f6ef67cc87449.tar.lz
nvim-treesitter-15f0813b6e0682e3f2c3b611610f6ef67cc87449.tar.xz
nvim-treesitter-15f0813b6e0682e3f2c3b611610f6ef67cc87449.tar.zst
nvim-treesitter-15f0813b6e0682e3f2c3b611610f6ef67cc87449.zip
tests/indent: add multiple C/C++ tests
Diffstat (limited to 'lua/tests/indent/cpp_spec.lua')
-rw-r--r--lua/tests/indent/cpp_spec.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/lua/tests/indent/cpp_spec.lua b/lua/tests/indent/cpp_spec.lua
new file mode 100644
index 000000000..a785de5b5
--- /dev/null
+++ b/lua/tests/indent/cpp_spec.lua
@@ -0,0 +1,23 @@
+local whole_file = require('nvim-treesitter.test_utils').indent_whole_file
+local scan_dir = require('plenary.scandir').scan_dir
+local Path = require('plenary.path')
+
+describe('indent C++:', function()
+ describe('whole file:', function()
+ local files = scan_dir('lua/tests/indent/c');
+ vim.list_extend(files, scan_dir('lua/tests/indent/cpp'))
+
+ for _, file in ipairs(files) do
+ local name = Path:new(file):make_relative('lua/tests/indent')
+ it(name, function()
+ whole_file(file, {
+ tabstop = 4,
+ shiftwidth = 4,
+ softtabstop = 0,
+ expandtab = true,
+ filetype = 'cpp',
+ })
+ end)
+ end
+ end)
+end)