mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 11:36:54 -04:00
tests/indent: add multiple C/C++ tests
This commit is contained in:
parent
77c97d0f8b
commit
15f0813b6e
20 changed files with 211 additions and 11 deletions
23
lua/tests/indent/cpp_spec.lua
Normal file
23
lua/tests/indent/cpp_spec.lua
Normal file
|
|
@ -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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue