-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use mini.test plugin, and convert all tests
- Loading branch information
1 parent
e3e70d8
commit 2eab1b9
Showing
25 changed files
with
907 additions
and
787 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.tests | ||
deps/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Run all test files | ||
test: deps/mini.nvim deps/plenary.nvim | ||
nvim --headless --noplugin -u ./scripts/minimal_init.lua -c "lua MiniTest.run()" | ||
|
||
# Run test from file at `$FILE` environment variable | ||
test_file: deps/mini.nvim deps/plenary.nvim | ||
nvim --headless --noplugin -u ./scripts/minimal_init.lua -c "lua MiniTest.run_file('$(FILE)')" | ||
|
||
# Download 'mini.nvim' to use its 'mini.test' testing module | ||
deps/mini.nvim: | ||
@mkdir -p deps | ||
git clone --filter=blob:none https://github.com/echasnovski/mini.nvim $@ | ||
|
||
deps/plenary.nvim: | ||
@mkdir -p deps | ||
git clone --filter=blob:none https://github.com/nvim-lua/plenary.nvim $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
-- Add current directory to 'runtimepath' to be able to use 'lua' files | ||
vim.cmd([[let &rtp.=','.getcwd()]]) | ||
|
||
-- Set up 'mini.test' only when calling headless Neovim (like with `make test`) | ||
if #vim.api.nvim_list_uis() == 0 then | ||
-- Add 'mini.nvim' to 'runtimepath' to be able to use 'mini.test' | ||
-- Assumed that 'mini.nvim' is stored in 'deps/mini.nvim' | ||
vim.cmd("set rtp+=deps/mini.nvim") | ||
vim.cmd("set rtp+=deps/plenary.nvim") | ||
|
||
-- Set up 'mini.test' | ||
require("mini.test").setup() | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
indent_type = "Spaces" | ||
indent_width = 2 | ||
column_width = 120 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.