Skip to content

Commit 31a5532

Browse files
committed
test: reduce ambiguity in expected suggestion
1 parent de4e46e commit 31a5532

6 files changed

+25
-25
lines changed

tests/screenshots/tests-test_suggestion.lua---suggestion()---accept_word,-1-word,-then-accept

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
--|---------|-----
2-
01|1, 2, 3,
3-
02|4, 5, 6,
4-
03|7, 8, 9,
2+
01|1 2 3
3+
02|4 5 6
4+
03|7 8 9
55
04|~
66
05|~
77
06|~
88
07|~
99
08|~
10-
09|<e] [+] 3,9 All
10+
09|<e] [+] 3,6 All
1111
10|-- INSERT --
1212

1313
--|---------|-----

tests/screenshots/tests-test_suggestion.lua---suggestion()---accept_word,-1-word,-then-dismiss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--|---------|-----
2-
01|1, 2, 3,
3-
02|4, 5, 6,
4-
03|7, 8
2+
01|1 2 3
3+
02|4 5 6
4+
03|7 8
55
04|~
66
05|~
77
06|~

tests/screenshots/tests-test_suggestion.lua---suggestion()---accept_word,-1-word,-works

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--|---------|-----
2-
01|1, 2, 3,
3-
02|4, 5, 6,
4-
03|7, 8
2+
01|1 2 3
3+
02|4 5 6
4+
03|7 8
55
04|~
66
05|~
77
06|~
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
--|---------|-----
2-
01|1, 2, 3,
3-
02|4, 5, 6,
4-
03|7, 8, 9
2+
01|1 2 3
3+
02|4 5 6
4+
03|7 8 9
55
04|~
66
05|~
77
06|~
88
07|~
99
08|~
10-
09|<e] [+] 3,7 All
10+
09|<e] [+] 3,5 All
1111
10|
1212

1313
--|---------|-----

tests/screenshots/tests-test_suggestion.lua---suggestion()---duplicated-keymap-yields-correct-error-message

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--|---------|---------|---------|---------|---------|---------|---------|---------|
2-
01|1, 2, 3,
3-
02|4, 5, 6,
4-
03|7, 8, 9,
2+
01|1 2 3
3+
02|4 5 6
4+
03|7 8 9
55
04|~
66
05|~
77
06|~
@@ -21,7 +21,7 @@
2121
20|~
2222
21|~
2323
22|~
24-
23|[No Name] [+] 3,10-17 All
24+
23|[No Name] [+] 3,7-9 All
2525
24|-- INSERT --
2626

2727
--|---------|---------|---------|---------|---------|---------|---------|---------|

tests/test_suggestion.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,20 @@ T["suggestion()"]["accept_word, 1 word, works"] = function()
6060
child.o.lines, child.o.columns = 10, 15
6161
child.config.suggestion = child.config.suggestion .. "auto_trigger = true," .. "keymap = { accept_word = '<C-e>' },"
6262
child.configure_copilot()
63-
child.type_keys("i1, 2, 3,", "<Esc>", "o4, 5, 6,", "<Esc>", "o7, ")
63+
child.type_keys("i1 2 3", "<Esc>", "o4 5 6", "<Esc>", "o7 ")
6464
child.wait_for_suggestion()
6565
child.type_keys("<C-e>", "<Esc>")
6666

6767
reference_screenshot(child.get_screenshot(), nil, { ignore_text = { 9, 10 }, ignore_attr = { 9, 10 } })
6868
end
6969

70-
T["suggestion()"]["accept_word, 3 words, works"] = function()
70+
T["suggestion()"]["accept_word, 2 words, works"] = function()
7171
child.o.lines, child.o.columns = 10, 15
7272
child.config.suggestion = child.config.suggestion .. "auto_trigger = true," .. "keymap = { accept_word = '<C-e>' },"
7373
child.configure_copilot()
74-
child.type_keys("i1, 2, 3,", "<Esc>", "o4, 5, 6,", "<Esc>", "o7, ")
74+
child.type_keys("i1 2 3", "<Esc>", "o4 5 6", "<Esc>", "o7 ")
7575
child.wait_for_suggestion()
76-
child.type_keys("<C-e>", "<C-e>", "<C-e>", "<Esc>")
76+
child.type_keys("<C-e>", "<C-e>", "<Esc>")
7777

7878
reference_screenshot(child.get_screenshot(), nil, { ignore_text = { 9, 10 }, ignore_attr = { 9, 10 } })
7979
end
@@ -87,7 +87,7 @@ T["suggestion()"]["accept_word, 1 word, then dismiss"] = function()
8787
.. "auto_trigger = true,"
8888
.. "keymap = { accept_word = '<C-e>', dismiss = '<Tab>' },"
8989
child.configure_copilot()
90-
child.type_keys("i1, 2, 3,", "<Esc>", "o4, 5, 6,", "<Esc>", "o7, ")
90+
child.type_keys("i1 2 3", "<Esc>", "o4 5 6", "<Esc>", "o7 ")
9191
child.wait_for_suggestion()
9292
child.type_keys("<C-e>", "<Tab>")
9393

@@ -100,7 +100,7 @@ T["suggestion()"]["accept_word, 1 word, then accept"] = function()
100100
.. "auto_trigger = true,"
101101
.. "keymap = { accept_word = '<C-e>', accept = '<Tab>' },"
102102
child.configure_copilot()
103-
child.type_keys("i1, 2, 3,", "<Esc>", "o4, 5, 6,", "<Esc>", "o7, ")
103+
child.type_keys("i1 2 3", "<Esc>", "o4 5 6", "<Esc>", "o7 ")
104104
child.wait_for_suggestion()
105105
child.type_keys("<C-e>", "<Tab>")
106106

@@ -170,7 +170,7 @@ end
170170
T["suggestion()"]["duplicated keymap yields correct error message"] = function()
171171
child.config.suggestion = child.config.suggestion .. "auto_trigger = true," .. "keymap = { accept = '<M-CR>' },"
172172
child.configure_copilot()
173-
child.type_keys("i1, 2, 3,", "<Esc>", "o4, 5, 6,", "<Esc>", "o7, ")
173+
child.type_keys("i1 2 3", "<Esc>", "o4 5 6", "<Esc>", "o7 ")
174174
child.wait_for_suggestion()
175175
child.type_keys("<M-CR>", "<Tab>")
176176
child.cmd_capture("Copilot disable")

0 commit comments

Comments
 (0)