robin/artio.nvim

minimal ui2 fuzzy finder for Neovim

git clone https://git.robinwobin.dev/robin/artio.nvim

robinmeta: add testsa7c3fc6

main
513 B19 linesraw
1describe("sort", function()
2  local sorter = require("artio").sorter
3  local lst = vim
4    .iter(ipairs({ "a", "b", "c" }))
5    :map(function(i, v)
6      return { id = i, v = v, text = v }
7    end)
8    :totable()
9
10  it("alphabet by a", function()
11    assert.equals(1, vim.tbl_get(sorter(lst, "a"), 1, 1))
12  end)
13  it("alphabet by b", function()
14    assert.equals(2, vim.tbl_get(sorter(lst, "b"), 2, 1))
15  end)
16  it("alphabet by c", function()
17    assert.equals(3, vim.tbl_get(sorter(lst, "c"), 3, 1))
18  end)
19end)