Skip to content

Commit 6ea6bcc

Browse files
committed
test: add test for lazy loading = false
1 parent 4c98663 commit 6ea6bcc

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
--|---------|---------|---------|---------|---------|---------|---------|---------|
2+
01|123
3+
02|456
4+
03|789
5+
04|~
6+
05|~
7+
06|~
8+
07|~
9+
08|~
10+
09|~
11+
10|~
12+
11|~
13+
12|~
14+
13|~
15+
14|~
16+
15|~
17+
16|~
18+
17|~
19+
18|~
20+
19|~
21+
20|~
22+
21|~
23+
22|~
24+
23|tests/files/file3.txt [+] 3,2 All
25+
24|-- INSERT --
26+
27+
--|---------|---------|---------|---------|---------|---------|---------|---------|
28+
01|00000000000000000000000000000000000000000000000000000000000000000000000000000000
29+
02|00000000000000000000000000000000000000000000000000000000000000000000000000000000
30+
03|01100000000000000000000000000000000000000000000000000000000000000000000000000000
31+
04|22222222222222222222222222222222222222222222222222222222222222222222222222222222
32+
05|22222222222222222222222222222222222222222222222222222222222222222222222222222222
33+
06|22222222222222222222222222222222222222222222222222222222222222222222222222222222
34+
07|22222222222222222222222222222222222222222222222222222222222222222222222222222222
35+
08|22222222222222222222222222222222222222222222222222222222222222222222222222222222
36+
09|22222222222222222222222222222222222222222222222222222222222222222222222222222222
37+
10|22222222222222222222222222222222222222222222222222222222222222222222222222222222
38+
11|22222222222222222222222222222222222222222222222222222222222222222222222222222222
39+
12|22222222222222222222222222222222222222222222222222222222222222222222222222222222
40+
13|22222222222222222222222222222222222222222222222222222222222222222222222222222222
41+
14|22222222222222222222222222222222222222222222222222222222222222222222222222222222
42+
15|22222222222222222222222222222222222222222222222222222222222222222222222222222222
43+
16|22222222222222222222222222222222222222222222222222222222222222222222222222222222
44+
17|22222222222222222222222222222222222222222222222222222222222222222222222222222222
45+
18|22222222222222222222222222222222222222222222222222222222222222222222222222222222
46+
19|22222222222222222222222222222222222222222222222222222222222222222222222222222222
47+
20|22222222222222222222222222222222222222222222222222222222222222222222222222222222
48+
21|22222222222222222222222222222222222222222222222222222222222222222222222222222222
49+
22|22222222222222222222222222222222222222222222222222222222222222222222222222222222
50+
23|33333333333333333333333333333333333333333333333333333333333333333333333333333333
51+
24|44444444444455555555555555555555555555555555555555555555555555555555555555555555

tests/test_client.lua

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,29 @@ T["client()"]["suggestions work when attaching to second buffer in a row"] = fun
171171
reference_screenshot(child.get_screenshot(), nil, { ignore_text = { 9, 10 }, ignore_attr = { 9, 10 } })
172172
end
173173

174+
T["client()"]["suggestions work when lazy is set to false"] = function()
175+
child.config.should_attach = [[function(bufnr, bufname)
176+
local buffername = bufname:match("([^/\\]+)$") or ""
177+
178+
if buffername == "file3.txt" then
179+
return true
180+
end
181+
182+
return false
183+
end]]
184+
child.config.suggestion = child.config.suggestion .. "auto_trigger = true,"
185+
186+
child.configure_copilot()
187+
child.cmd("e tests/files/file1.txt")
188+
child.cmd("e tests/files/file2.txt")
189+
child.type_keys("i123", "<Esc>")
190+
child.cmd("e tests/files/file3.txt")
191+
child.type_keys("i123", "<Esc>", "o456", "<Esc>", "o7")
192+
child.wait_for_suggestion()
193+
194+
reference_screenshot(child.get_screenshot(), nil, { ignore_text = { 9, 10 }, ignore_attr = { 9, 10 } })
195+
end
196+
174197
T["client()"]["will not attach to buffer due to filetype exclusion"] = function()
175198
child.config.filetypes = [[
176199
["*"] = false,

0 commit comments

Comments
 (0)