on master help sign in
cleanup integration tests
c6f169bPascal Kuthe
helix-term/tests/test/commands.rs+34−60
@@ -12,15 +12,13 @@ async fn test_selection_duplication() -> anyhow::Result<()> {
12 #[lo|]#rem
12 #[lo|]#rem
13 ipsum
13 ipsum
14 dolor
14 dolor
15− "})
15+ "}),
16− .as_str(),
17 "CC",
16 "CC",
18 platform_line(indoc! {"\
17 platform_line(indoc! {"\
19 #(lo|)#rem
18 #(lo|)#rem
20 #(ip|)#sum
19 #(ip|)#sum
21 #[do|]#lor
20 #[do|]#lor
22− "})
21+ "}),
23− .as_str(),
24 ))
22 ))
25 .await?;
23 .await?;
26
24
@@ -30,15 +28,13 @@ async fn test_selection_duplication() -> anyhow::Result<()> {
30 #[|lo]#rem
28 #[|lo]#rem
31 ipsum
29 ipsum
32 dolor
30 dolor
33− "})
31+ "}),
34− .as_str(),
35 "CC",
32 "CC",
36 platform_line(indoc! {"\
33 platform_line(indoc! {"\
37 #(|lo)#rem
34 #(|lo)#rem
38 #(|ip)#sum
35 #(|ip)#sum
39 #[|do]#lor
36 #[|do]#lor
40− "})
37+ "}),
41− .as_str(),
42 ))
38 ))
43 .await?;
39 .await?;
44
40
@@ -47,14 +43,12 @@ async fn test_selection_duplication() -> anyhow::Result<()> {
47 platform_line(indoc! {"\
43 platform_line(indoc! {"\
48 test
44 test
49 #[testitem|]#
45 #[testitem|]#
50− "})
46+ "}),
51− .as_str(),
52 "<A-C>",
47 "<A-C>",
53 platform_line(indoc! {"\
48 platform_line(indoc! {"\
54 test
49 test
55 #[testitem|]#
50 #[testitem|]#
56− "})
51+ "}),
57− .as_str(),
58 ))
52 ))
59 .await?;
53 .await?;
60
54
@@ -63,14 +57,12 @@ async fn test_selection_duplication() -> anyhow::Result<()> {
63 platform_line(indoc! {"\
57 platform_line(indoc! {"\
64 test
58 test
65 #[test|]#
59 #[test|]#
66− "})
60+ "}),
67− .as_str(),
68 "<A-C>",
61 "<A-C>",
69 platform_line(indoc! {"\
62 platform_line(indoc! {"\
70 #[test|]#
63 #[test|]#
71 #(test|)#
64 #(test|)#
72− "})
65+ "}),
73− .as_str(),
74 ))
66 ))
75 .await?;
67 .await?;
76
68
@@ -79,14 +71,12 @@ async fn test_selection_duplication() -> anyhow::Result<()> {
79 platform_line(indoc! {"\
71 platform_line(indoc! {"\
80 #[testitem|]#
72 #[testitem|]#
81 test
73 test
82− "})
74+ "}),
83− .as_str(),
84 "C",
75 "C",
85 platform_line(indoc! {"\
76 platform_line(indoc! {"\
86 #[testitem|]#
77 #[testitem|]#
87 test
78 test
88− "})
79+ "}),
89− .as_str(),
90 ))
80 ))
91 .await?;
81 .await?;
92
82
@@ -95,14 +85,12 @@ async fn test_selection_duplication() -> anyhow::Result<()> {
95 platform_line(indoc! {"\
85 platform_line(indoc! {"\
96 #[test|]#
86 #[test|]#
97 test
87 test
98− "})
88+ "}),
99− .as_str(),
100 "C",
89 "C",
101 platform_line(indoc! {"\
90 platform_line(indoc! {"\
102 #(test|)#
91 #(test|)#
103 #[test|]#
92 #[test|]#
104− "})
93+ "}),
105− .as_str(),
106 ))
94 ))
107 .await?;
95 .await?;
108 Ok(())
96 Ok(())
@@ -174,15 +162,13 @@ async fn test_multi_selection_paste() -> anyhow::Result<()> {
174 #[|lorem]#
162 #[|lorem]#
175 #(|ipsum)#
163 #(|ipsum)#
176 #(|dolor)#
164 #(|dolor)#
177− "})
165+ "}),
178− .as_str(),
179 "yp",
166 "yp",
180 platform_line(indoc! {"\
167 platform_line(indoc! {"\
181 lorem#[|lorem]#
168 lorem#[|lorem]#
182 ipsum#(|ipsum)#
169 ipsum#(|ipsum)#
183 dolor#(|dolor)#
170 dolor#(|dolor)#
184− "})
171+ "}),
185− .as_str(),
186 ))
172 ))
187 .await?;
173 .await?;
188
174
@@ -197,8 +183,7 @@ async fn test_multi_selection_shell_commands() -> anyhow::Result<()> {
197 #[|lorem]#
183 #[|lorem]#
198 #(|ipsum)#
184 #(|ipsum)#
199 #(|dolor)#
185 #(|dolor)#
200− "})
186+ "}),
201− .as_str(),
202 "|echo foo<ret>",
187 "|echo foo<ret>",
203 platform_line(indoc! {"\
188 platform_line(indoc! {"\
204 #[|foo\n]#
189 #[|foo\n]#
@@ -207,8 +192,7 @@ async fn test_multi_selection_shell_commands() -> anyhow::Result<()> {
207
192
208 #(|foo\n)#
193 #(|foo\n)#
209
194
210− "})
195+ "}),
211− .as_str(),
212 ))
196 ))
213 .await?;
197 .await?;
214
198
@@ -218,8 +202,7 @@ async fn test_multi_selection_shell_commands() -> anyhow::Result<()> {
218 #[|lorem]#
202 #[|lorem]#
219 #(|ipsum)#
203 #(|ipsum)#
220 #(|dolor)#
204 #(|dolor)#
221− "})
205+ "}),
222− .as_str(),
223 "!echo foo<ret>",
206 "!echo foo<ret>",
224 platform_line(indoc! {"\
207 platform_line(indoc! {"\
225 #[|foo\n]#
208 #[|foo\n]#
@@ -228,8 +211,7 @@ async fn test_multi_selection_shell_commands() -> anyhow::Result<()> {
228 ipsum
211 ipsum
229 #(|foo\n)#
212 #(|foo\n)#
230 dolor
213 dolor
231− "})
214+ "}),
232− .as_str(),
233 ))
215 ))
234 .await?;
216 .await?;
235
217
@@ -239,8 +221,7 @@ async fn test_multi_selection_shell_commands() -> anyhow::Result<()> {
239 #[|lorem]#
221 #[|lorem]#
240 #(|ipsum)#
222 #(|ipsum)#
241 #(|dolor)#
223 #(|dolor)#
242− "})
224+ "}),
243− .as_str(),
244 "<A-!>echo foo<ret>",
225 "<A-!>echo foo<ret>",
245 platform_line(indoc! {"\
226 platform_line(indoc! {"\
246 lorem#[|foo\n]#
227 lorem#[|foo\n]#
@@ -249,8 +230,7 @@ async fn test_multi_selection_shell_commands() -> anyhow::Result<()> {
249
230
250 dolor#(|foo\n)#
231 dolor#(|foo\n)#
251
232
252− "})
233+ "}),
253− .as_str(),
254 ))
234 ))
255 .await?;
235 .await?;
256
236
@@ -294,16 +274,14 @@ async fn test_extend_line() -> anyhow::Result<()> {
294 ipsum
274 ipsum
295 dolor
275 dolor
296
276
297− "})
277+ "}),
298− .as_str(),
299 "x2x",
278 "x2x",
300 platform_line(indoc! {"\
279 platform_line(indoc! {"\
301 #[lorem
280 #[lorem
302 ipsum
281 ipsum
303 dolor\n|]#
282 dolor\n|]#
304
283
305− "})
284+ "}),
306− .as_str(),
307 ))
285 ))
308 .await?;
286 .await?;
309
287
@@ -313,15 +291,13 @@ async fn test_extend_line() -> anyhow::Result<()> {
313 #[l|]#orem
291 #[l|]#orem
314 ipsum
292 ipsum
315
293
316− "})
294+ "}),
317− .as_str(),
318 "2x",
295 "2x",
319 platform_line(indoc! {"\
296 platform_line(indoc! {"\
320 #[lorem
297 #[lorem
321 ipsum\n|]#
298 ipsum\n|]#
322
299
323− "})
300+ "}),
324− .as_str(),
325 ))
301 ))
326 .await?;
302 .await?;
327
303
@@ -390,15 +366,15 @@ async fn test_character_info() -> anyhow::Result<()> {
390async fn test_delete_char_backward() -> anyhow::Result<()> {
366async fn test_delete_char_backward() -> anyhow::Result<()> {
391 // don't panic when deleting overlapping ranges
367 // don't panic when deleting overlapping ranges
392 test((
368 test((
393− platform_line("#(x|)# #[x|]#").as_str(),
369+ platform_line("#(x|)# #[x|]#"),
394 "c<space><backspace><esc>",
370 "c<space><backspace><esc>",
395− platform_line("#[\n|]#").as_str(),
371+ platform_line("#[\n|]#"),
396 ))
372 ))
397 .await?;
373 .await?;
398 test((
374 test((
399− platform_line("#( |)##( |)#a#( |)#axx#[x|]#a").as_str(),
375+ platform_line("#( |)##( |)#a#( |)#axx#[x|]#a"),
400 "li<backspace><esc>",
376 "li<backspace><esc>",
401− platform_line("#(a|)##(|a)#xx#[|a]#").as_str(),
377+ platform_line("#(a|)##(|a)#xx#[|a]#"),
402 ))
378 ))
403 .await?;
379 .await?;
404
380
@@ -409,9 +385,9 @@ async fn test_delete_char_backward() -> anyhow::Result<()> {
409async fn test_delete_word_backward() -> anyhow::Result<()> {
385async fn test_delete_word_backward() -> anyhow::Result<()> {
410 // don't panic when deleting overlapping ranges
386 // don't panic when deleting overlapping ranges
411 test((
387 test((
412− platform_line("fo#[o|]#ba#(r|)#").as_str(),
388+ platform_line("fo#[o|]#ba#(r|)#"),
413 "a<C-w><esc>",
389 "a<C-w><esc>",
414− platform_line("#[\n|]#").as_str(),
390+ platform_line("#[\n|]#"),
415 ))
391 ))
416 .await?;
392 .await?;
417 Ok(())
393 Ok(())
@@ -421,9 +397,9 @@ async fn test_delete_word_backward() -> anyhow::Result<()> {
421async fn test_delete_word_forward() -> anyhow::Result<()> {
397async fn test_delete_word_forward() -> anyhow::Result<()> {
422 // don't panic when deleting overlapping ranges
398 // don't panic when deleting overlapping ranges
423 test((
399 test((
424− platform_line("fo#[o|]#b#(|ar)#").as_str(),
400+ platform_line("fo#[o|]#b#(|ar)#"),
425 "i<A-d><esc>",
401 "i<A-d><esc>",
426− platform_line("fo#[\n|]#").as_str(),
402+ platform_line("fo#[\n|]#"),
427 ))
403 ))
428 .await?;
404 .await?;
429 Ok(())
405 Ok(())
@@ -437,16 +413,14 @@ async fn test_delete_char_forward() -> anyhow::Result<()> {
437 #(abc|)#ef
413 #(abc|)#ef
438 #(abc|)#f
414 #(abc|)#f
439 #(abc|)#
415 #(abc|)#
440− "})
416+ "}),
441− .as_str(),
442 "a<del><esc>",
417 "a<del><esc>",
443 platform_line(indoc! {"\
418 platform_line(indoc! {"\
444 #[abc|]#ef
419 #[abc|]#ef
445 #(abc|)#f
420 #(abc|)#f
446 #(abc|)#
421 #(abc|)#
447 #(abc|)#
422 #(abc|)#
448− "})
423+ "}),
449− .as_str(),
450 ))
424 ))
451 .await?;
425 .await?;
452
426