forked from zbirenbaum/copilot.lua
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_base_to_organize.lua
More file actions
34 lines (28 loc) · 919 Bytes
/
test_base_to_organize.lua
File metadata and controls
34 lines (28 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
local eq = MiniTest.expect.equality
local child_helper = require("tests.child_helper")
local child = child_helper.new_child_neovim("test_base_to_organize")
local T = MiniTest.new_set({
hooks = {
pre_case = function()
child.run_pre_case(true)
child.lua([[s = require('copilot.status')]])
child.lua([[a = require('copilot.api')]])
end,
post_once = child.stop,
},
})
T["lua()"] = MiniTest.new_set()
T["lua()"]["setup not called, copilot.setup_done is false"] = function()
eq(child.lua("return M.setup_done"), false)
end
T["lua()"]["setup called, copilot.setup_done is true"] = function()
child.configure_copilot()
eq(child.lua("return M.setup_done"), true)
end
T["lua()"]["api.status reroutes to status"] = function()
child.configure_copilot()
child.lua("s.data.status = 'test'")
local status = child.lua("return a.status.data.status")
eq(status, "test")
end
return T