tangled
alpha
login
or
join now
robinwobin.dev
/
artio.nvim
3
fork
atom
minimal extui fuzzy finder for neovim
3
fork
atom
overview
issues
pulls
pipelines
meta: add tests
robinwobin.dev
1 week ago
a7c3fc62
713289fb
+37
4 changed files
expand all
collapse all
unified
split
.busted
tests
minimal_init.vim
nvim-shim
sorter_spec.lua
+13
.busted
···
1
1
+
return {
2
2
+
_all = {
3
3
+
coverage = false,
4
4
+
lpath = "lua/?.lua;lua/?/init.lua",
5
5
+
lua = "./tests/nvim-shim",
6
6
+
},
7
7
+
default = {
8
8
+
verbose = true,
9
9
+
},
10
10
+
tests = {
11
11
+
verbose = true,
12
12
+
},
13
13
+
}
+2
tests/minimal_init.vim
···
1
1
+
set rtp+=.
2
2
+
runtime! plugin/plenary.vim
+3
tests/nvim-shim
···
1
1
+
#!/usr/bin/env sh
2
2
+
3
3
+
nvim -l "$@"
+19
tests/sorter_spec.lua
···
1
1
+
describe("sort", function()
2
2
+
local sorter = require("artio").sorter
3
3
+
local lst = vim
4
4
+
.iter(ipairs({ "a", "b", "c" }))
5
5
+
:map(function(i, v)
6
6
+
return { id = i, v = v, text = v }
7
7
+
end)
8
8
+
:totable()
9
9
+
10
10
+
it("alphabet by a", function()
11
11
+
assert.equals(1, vim.tbl_get(sorter(lst, "a"), 1, 1))
12
12
+
end)
13
13
+
it("alphabet by b", function()
14
14
+
assert.equals(2, vim.tbl_get(sorter(lst, "b"), 2, 1))
15
15
+
end)
16
16
+
it("alphabet by c", function()
17
17
+
assert.equals(3, vim.tbl_get(sorter(lst, "c"), 3, 1))
18
18
+
end)
19
19
+
end)