diff options
| author | Jędrzej Boczar <yendreij@gmail.com> | 2021-04-17 22:45:42 +0200 |
|---|---|---|
| committer | Kiyan <yazdani.kiyan@protonmail.com> | 2021-04-23 21:21:38 +0200 |
| commit | 77c97d0f8bdc16bdd2a0800fe66bf3ffddfe6ec3 (patch) | |
| tree | ba6c4bc6738930aba9db96b1ac3380a6b922f8ed /lua/tests/indent/c_spec.lua | |
| parent | db1b6dc1cb9a1604a15fd2e57fc098cade9913d3 (diff) | |
tests/indent: refactor indent test runner and auto-discover language test files
Diffstat (limited to 'lua/tests/indent/c_spec.lua')
| -rw-r--r-- | lua/tests/indent/c_spec.lua | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lua/tests/indent/c_spec.lua b/lua/tests/indent/c_spec.lua index 5176312b..38613103 100644 --- a/lua/tests/indent/c_spec.lua +++ b/lua/tests/indent/c_spec.lua @@ -1,18 +1,18 @@ local whole_file = require('nvim-treesitter.test_utils').indent_whole_file +local scan_dir = require('plenary.scandir').scan_dir -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 +describe('indent C:', function() + describe('whole file:', function() + local files = scan_dir('lua/tests/indent/c'); + for _, file in ipairs(files) do + it(vim.fn.fnamemodify(file, ':t'), function() + whole_file(file, { + tabstop = 4, + shiftwidth = 4, + softtabstop = 0, + expandtab = true, + }) + end) + end + end) end) |
