mirror of
https://github.com/ThePrimeagen/harpoon.git
synced 2025-07-14 01:50:27 +00:00
fix: #410 addresses the pr, which is requesting a feature
This commit is contained in:
parent
9e869aae22
commit
1f36517870
@ -1,5 +1,7 @@
|
|||||||
local utils = require("harpoon.test.utils")
|
local utils = require("harpoon.test.utils")
|
||||||
local harpoon = require("harpoon")
|
local harpoon = require("harpoon")
|
||||||
|
local Extensions = require("harpoon.extensions")
|
||||||
|
local Config = require("harpoon.config")
|
||||||
|
|
||||||
local eq = assert.are.same
|
local eq = assert.are.same
|
||||||
|
|
||||||
@ -104,4 +106,36 @@ describe("harpoon", function()
|
|||||||
{ value = file_name_1, context = { row = row_1, col = col_1 } },
|
{ value = file_name_1, context = { row = row_1, col = col_1 } },
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it("extension testing: setup and create list", function()
|
||||||
|
local list_created = false
|
||||||
|
local list_name = ""
|
||||||
|
local setup = false
|
||||||
|
local config = {}
|
||||||
|
|
||||||
|
harpoon:extend({
|
||||||
|
[Extensions.event_names.LIST_CREATED] = function(list)
|
||||||
|
list_created = true
|
||||||
|
list_name = list.name
|
||||||
|
end,
|
||||||
|
[Extensions.event_names.SETUP_CALLED] = function(c)
|
||||||
|
setup = true
|
||||||
|
config = c
|
||||||
|
end,
|
||||||
|
});
|
||||||
|
|
||||||
|
harpoon:setup({
|
||||||
|
foo = { }
|
||||||
|
});
|
||||||
|
harpoon:list()
|
||||||
|
|
||||||
|
eq(true, setup)
|
||||||
|
eq({}, config.foo)
|
||||||
|
|
||||||
|
eq(true, list_created)
|
||||||
|
eq(Config.DEFAULT_LIST, list_name)
|
||||||
|
|
||||||
|
end)
|
||||||
|
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user