File: fixtests-check-for-eof-on-exit-of-nvim-p.patch

package info (click to toggle)
neovim 0.7.2-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 53,496 kB
  • sloc: ansic: 237,952; python: 3,358; sh: 2,080; awk: 704; makefile: 398; perl: 335; lisp: 129; xml: 63; ruby: 6
file content (675 lines) | stat: -rw-r--r-- 25,621 bytes parent folder | download
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
From: bfredl <bjorn.linse@gmail.com>
Date: Wed, 8 Jun 2022 23:22:50 +0200
X-Dgit-Generated: 0.7.2-4 ea5a4488961bd87df4da9699bf9ddb25c385264e
Subject: fix(tests): check for EOF on exit of nvim properly

Signed-off-by: James McCoy <jamessan@debian.org>

---

diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index 04b79a715..107cf32c0 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -25,6 +25,7 @@ local tmpname = helpers.tmpname
 local write_file = helpers.write_file
 local exec_lua = helpers.exec_lua
 local exc_exec = helpers.exc_exec
+local expect_exit = helpers.expect_exit
 
 local pcall_err = helpers.pcall_err
 local format_string = helpers.format_string
@@ -2597,7 +2598,7 @@ describe('API', function()
 
     it('does not cause heap-use-after-free on exit while setting options', function()
       command('au OptionSet * q')
-      command('silent! call nvim_create_buf(0, 1)')
+      expect_exit(command, 'silent! call nvim_create_buf(0, 1)')
     end)
   end)
 
diff --git a/test/functional/core/fileio_spec.lua b/test/functional/core/fileio_spec.lua
index c68bc18ee..bc025771d 100644
--- a/test/functional/core/fileio_spec.lua
+++ b/test/functional/core/fileio_spec.lua
@@ -16,12 +16,13 @@ local trim = helpers.trim
 local currentdir = helpers.funcs.getcwd
 local iswin = helpers.iswin
 local assert_alive = helpers.assert_alive
+local expect_exit = helpers.expect_exit
 
 describe('fileio', function()
   before_each(function()
   end)
   after_each(function()
-    command(':qall!')
+    expect_exit(command, ':qall!')
     os.remove('Xtest_startup_shada')
     os.remove('Xtest_startup_file1')
     os.remove('Xtest_startup_file1~')
diff --git a/test/functional/ex_cmds/mksession_spec.lua b/test/functional/ex_cmds/mksession_spec.lua
index 2702fb196..2bec31d41 100644
--- a/test/functional/ex_cmds/mksession_spec.lua
+++ b/test/functional/ex_cmds/mksession_spec.lua
@@ -10,6 +10,7 @@ local funcs = helpers.funcs
 local matches = helpers.matches
 local pesc = helpers.pesc
 local rmdir = helpers.rmdir
+local expect_exit = helpers.expect_exit
 
 local file_prefix = 'Xtest-functional-ex_cmds-mksession_spec'
 
@@ -41,7 +42,7 @@ describe(':mksession', function()
     command('mksession '..session_file)
 
     -- Create a new test instance of Nvim.
-    command('qall!')
+    expect_exit(command, 'qall!')
     clear()
     -- Restore session.
     command('source '..session_file)
@@ -106,7 +107,8 @@ describe(':mksession', function()
     command('terminal echo $PWD')
     command('cd '..cwd_dir)
     command('mksession '..session_path)
-    command('qall!')
+    command('bdelete!')
+    expect_exit(command, 'qall!')
 
     -- Create a new test instance of Nvim.
     clear()
@@ -114,6 +116,6 @@ describe(':mksession', function()
 
     local expected_cwd = cwd_dir..'/'..tab_dir
     matches('^term://'..pesc(expected_cwd)..'//%d+:', funcs.expand('%'))
-    command('qall!')
+    command('bdelete!')
   end)
 end)
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index 6cc0bae51..d44f34dd8 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -272,6 +272,13 @@ function module.command(cmd)
   module.request('nvim_command', cmd)
 end
 
+
+-- use for commands which expect nvim to quit
+function module.expect_exit(...)
+  eq("EOF was received from Nvim. Likely the Nvim process crashed.",
+     module.pcall_err(...))
+end
+
 -- Evaluates a VimL expression.
 -- Fails on VimL error, but does not update v:errmsg.
 function module.eval(expr)
diff --git a/test/functional/legacy/008_autocommands_spec.lua b/test/functional/legacy/008_autocommands_spec.lua
index 002f037d0..4088cd164 100644
--- a/test/functional/legacy/008_autocommands_spec.lua
+++ b/test/functional/legacy/008_autocommands_spec.lua
@@ -6,6 +6,7 @@ local source = helpers.source
 local clear, command, expect, eq, eval = helpers.clear, helpers.command, helpers.expect, helpers.eq, helpers.eval
 local write_file, dedent = helpers.write_file, helpers.dedent
 local read_file = helpers.read_file
+local expect_exit = helpers.expect_exit
 
 describe('autocommands that delete and unload buffers:', function()
   local test_file = 'Xtest-008_autocommands.out'
@@ -78,7 +79,7 @@ describe('autocommands that delete and unload buffers:', function()
     command('silent! edit Xxx1')
     command('silent! edit Makefile') -- an existing file
     command('silent! split new2')
-    command('silent! quit')
+    expect_exit(command, 'silent! quit')
     eq('VimLeave done',
        string.match(read_file(test_file), "^%s*(.-)%s*$"))
   end)
diff --git a/test/functional/legacy/012_directory_spec.lua b/test/functional/legacy/012_directory_spec.lua
index f666e5146..dd207ca0b 100644
--- a/test/functional/legacy/012_directory_spec.lua
+++ b/test/functional/legacy/012_directory_spec.lua
@@ -16,6 +16,7 @@ local insert = helpers.insert
 local command = helpers.command
 local write_file = helpers.write_file
 local curbufmeths = helpers.curbufmeths
+local expect_exit = helpers.expect_exit
 
 local function ls_dir_sorted(dirname)
   local files = {}
@@ -43,7 +44,7 @@ describe("'directory' option", function()
     clear()
   end)
   teardown(function()
-    command('qall!')
+    expect_exit(command, 'qall!')
     helpers.rmdir('Xtest.je')
     helpers.rmdir('Xtest2')
     os.remove('Xtest1')
diff --git a/test/functional/legacy/031_close_commands_spec.lua b/test/functional/legacy/031_close_commands_spec.lua
index 64c67c988..d02b1a204 100644
--- a/test/functional/legacy/031_close_commands_spec.lua
+++ b/test/functional/legacy/031_close_commands_spec.lua
@@ -17,6 +17,7 @@ local source = helpers.source
 local insert = helpers.insert
 local expect = helpers.expect
 local feed_command = helpers.feed_command
+local expect_exit = helpers.expect_exit
 
 describe('Commands that close windows and/or buffers', function()
   local function cleanup()
@@ -118,7 +119,7 @@ describe('Commands that close windows and/or buffers', function()
     feed_command('q!')
     feed('<CR>')
     expect('testtext 1')
-    source([[
+    expect_exit(source, [[
       q!
       " Now nvim should have exited
       throw "Oh, Not finished yet."]])
diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua
index c28fd402e..df88ba762 100644
--- a/test/functional/lua/vim_spec.lua
+++ b/test/functional/lua/vim_spec.lua
@@ -22,7 +22,7 @@ local remove_trace = helpers.remove_trace
 local mkdir_p = helpers.mkdir_p
 local rmdir = helpers.rmdir
 local write_file = helpers.write_file
-
+local expect_exit = helpers.expect_exit
 
 describe('lua stdlib', function()
   before_each(clear)
@@ -2663,9 +2663,7 @@ describe('lua: builtin modules', function()
 
   it('does not work when disabled without runtime', function()
     clear{args={'--luamod-dev'}, env={VIMRUNTIME='fixtures/a'}}
-    -- error checking could be better here. just check that --luamod-dev
-    -- does anything at all by breaking with missing runtime..
-    eq(nil, exec_lua[[return vim.tbl_count {x=1,y=2}]])
+    expect_exit(exec_lua, [[return vim.tbl_count {x=1,y=2}]])
   end)
 end)
 
diff --git a/test/functional/options/defaults_spec.lua b/test/functional/options/defaults_spec.lua
index 6620c9ace..439ce30ae 100644
--- a/test/functional/options/defaults_spec.lua
+++ b/test/functional/options/defaults_spec.lua
@@ -17,6 +17,7 @@ local mkdir = helpers.mkdir
 local rmdir = helpers.rmdir
 local alter_slashes = helpers.alter_slashes
 local tbl_contains = helpers.tbl_contains
+local expect_exit = helpers.expect_exit
 
 describe('startup defaults', function()
   describe(':filetype', function()
@@ -174,7 +175,7 @@ describe('startup defaults', function()
     command('write')
     local f = eval('fnamemodify(@%,":p")')
     assert(string.len(f) > 3)
-    command('qall')
+    expect_exit(command, 'qall')
     clear{args={}, args_rm={'-i'}, env=env}
     eq({ f }, eval('v:oldfiles'))
     os.remove('Xtest-foo')
diff --git a/test/functional/shada/buffers_spec.lua b/test/functional/shada/buffers_spec.lua
index 04c9c01d7..26a4569fc 100644
--- a/test/functional/shada/buffers_spec.lua
+++ b/test/functional/shada/buffers_spec.lua
@@ -2,6 +2,7 @@
 local helpers = require('test.functional.helpers')(after_each)
 local nvim_command, funcs, eq, curbufmeths =
   helpers.command, helpers.funcs, helpers.eq, helpers.curbufmeths
+local expect_exit = helpers.expect_exit
 
 local shada_helpers = require('test.functional.shada.helpers')
 local reset, clear = shada_helpers.reset, shada_helpers.clear
@@ -15,7 +16,7 @@ describe('shada support code', function()
     reset('set shada+=%')
     nvim_command('edit ' .. testfilename)
     nvim_command('edit ' .. testfilename_2)
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset('set shada+=%')
     eq(3, funcs.bufnr('$'))
     eq('', funcs.bufname(1))
@@ -27,7 +28,7 @@ describe('shada support code', function()
     reset('set shada+=%')
     nvim_command('edit ' .. testfilename)
     nvim_command('edit ' .. testfilename_2)
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     eq(1, funcs.bufnr('$'))
     eq('', funcs.bufname(1))
@@ -37,7 +38,7 @@ describe('shada support code', function()
     reset()
     nvim_command('edit ' .. testfilename)
     nvim_command('edit ' .. testfilename_2)
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset('set shada+=%')
     eq(1, funcs.bufnr('$'))
     eq('', funcs.bufname(1))
@@ -48,7 +49,7 @@ describe('shada support code', function()
     nvim_command('edit ' .. testfilename)
     nvim_command('edit ' .. testfilename_2)
     curbufmeths.set_option('buflisted', false)
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset('set shada+=%')
     eq(2, funcs.bufnr('$'))
     eq('', funcs.bufname(1))
@@ -60,7 +61,7 @@ describe('shada support code', function()
     nvim_command('edit ' .. testfilename)
     nvim_command('edit ' .. testfilename_2)
     curbufmeths.set_option('buftype', 'quickfix')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset('set shada+=%')
     eq(2, funcs.bufnr('$'))
     eq('', funcs.bufname(1))
@@ -73,7 +74,7 @@ describe('shada support code', function()
     nvim_command('enew')
     curbufmeths.set_lines(0, 1, true, {'bar'})
     eq(2, funcs.bufnr('$'))
-    nvim_command('qall!')
+    expect_exit(nvim_command, 'qall!')
     reset('set shada+=% hidden')
     eq(1, funcs.bufnr('$'))
     eq('', funcs.bufname(1))
@@ -83,7 +84,7 @@ describe('shada support code', function()
     reset('set shada+=%1')
     nvim_command('edit ' .. testfilename)
     nvim_command('edit ' .. testfilename_2)
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset('set shada+=%1')
     eq(2, funcs.bufnr('$'))
     eq('', funcs.bufname(1))
diff --git a/test/functional/shada/history_spec.lua b/test/functional/shada/history_spec.lua
index 84cc34c7c..d1daf6c7c 100644
--- a/test/functional/shada/history_spec.lua
+++ b/test/functional/shada/history_spec.lua
@@ -3,6 +3,7 @@ local helpers = require('test.functional.helpers')(after_each)
 local nvim_command, funcs, meths, nvim_feed, eq =
   helpers.command, helpers.funcs, helpers.meths, helpers.feed, helpers.eq
 local assert_alive = helpers.assert_alive
+local expect_exit = helpers.expect_exit
 
 local shada_helpers = require('test.functional.shada.helpers')
 local reset, clear = shada_helpers.reset, shada_helpers.clear
@@ -25,13 +26,13 @@ describe('ShaDa support code', function()
     nvim_command('set shada=\'0 history=2')
     nvim_feed(':" Test\n')
     nvim_feed(':" Test 2\n')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     nvim_command('set shada=\'0 history=2')
     nvim_command('rshada')
     eq('" Test 2', funcs.histget(':', -1))
     eq('" Test', funcs.histget(':', -2))
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
   end)
 
   it('respects &history when dumping',
@@ -138,7 +139,7 @@ describe('ShaDa support code', function()
     nvim_command('set hlsearch shada-=h')
     nvim_feed('/test\n')
     eq(1, meths.get_vvar('hlsearch'))
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     eq(1, meths.get_vvar('hlsearch'))
   end)
@@ -147,7 +148,7 @@ describe('ShaDa support code', function()
     nvim_command('set hlsearch shada-=h')
     nvim_feed('/test\n')
     nvim_command('nohlsearch')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     eq(0, meths.get_vvar('hlsearch'))
   end)
@@ -156,7 +157,7 @@ describe('ShaDa support code', function()
     nvim_command('set hlsearch')
     nvim_feed('/test\n')
     eq(1, meths.get_vvar('hlsearch'))
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     eq(0, meths.get_vvar('hlsearch'))
   end)
@@ -175,7 +176,7 @@ describe('ShaDa support code', function()
   it('dumps and loads history with UTF-8 characters', function()
     reset()
     nvim_feed(':echo "«"\n')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     eq('echo "«"', funcs.histget(':', -1))
   end)
@@ -183,7 +184,7 @@ describe('ShaDa support code', function()
   it('dumps and loads replacement with UTF-8 characters',
   function()
     nvim_command('substitute/./«/ge')
-    nvim_command('qall!')
+    expect_exit(nvim_command, 'qall!')
     reset()
     funcs.setline('.', {'.'})
     nvim_command('&')
@@ -193,7 +194,7 @@ describe('ShaDa support code', function()
   it('dumps and loads substitute pattern with UTF-8 characters',
   function()
     nvim_command('substitute/«/./ge')
-    nvim_command('qall!')
+    expect_exit(nvim_command, 'qall!')
     reset()
     funcs.setline('.', {'«\171'})
     nvim_command('&')
@@ -204,7 +205,7 @@ describe('ShaDa support code', function()
   function()
     nvim_command('silent! /«/')
     nvim_command('set shada+=/0')
-    nvim_command('qall!')
+    expect_exit(nvim_command, 'qall!')
     reset()
     funcs.setline('.', {'\171«'})
     nvim_command('~&')
@@ -217,7 +218,7 @@ describe('ShaDa support code', function()
     -- \171 is U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK in latin1
     nvim_command('silent! /\171/')
     nvim_command('set shada+=/0')
-    nvim_command('qall!')
+    expect_exit(nvim_command, 'qall!')
     reset()
     funcs.setline('.', {'\171«'})
     nvim_command('~&')
diff --git a/test/functional/shada/marks_spec.lua b/test/functional/shada/marks_spec.lua
index 153a1c346..a91be1884 100644
--- a/test/functional/shada/marks_spec.lua
+++ b/test/functional/shada/marks_spec.lua
@@ -4,6 +4,7 @@ local meths, curwinmeths, curbufmeths, nvim_command, funcs, eq =
   helpers.meths, helpers.curwinmeths, helpers.curbufmeths, helpers.command,
   helpers.funcs, helpers.eq
 local exc_exec, exec_capture = helpers.exc_exec, helpers.exec_capture
+local expect_exit = helpers.expect_exit
 
 local shada_helpers = require('test.functional.shada.helpers')
 local reset, clear = shada_helpers.reset, shada_helpers.clear
@@ -79,7 +80,7 @@ describe('ShaDa support code', function()
     nvim_command('mark a')
     nvim_command('2')
     nvim_command('kb')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     nvim_command('edit ' .. testfilename)
     nvim_command('normal! `a')
@@ -92,7 +93,7 @@ describe('ShaDa support code', function()
   it('is able to dump and read back mark "', function()
     nvim_command('edit ' .. testfilename)
     nvim_command('2')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     nvim_command('edit ' .. testfilename)
     nvim_command('normal! `"')
@@ -104,7 +105,7 @@ describe('ShaDa support code', function()
     nvim_command('tabedit ' .. testfilename_2)
     nvim_command('2')
     nvim_command('q!')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     nvim_command('edit ' .. testfilename_2)
     nvim_command('normal! `"')
@@ -116,7 +117,7 @@ describe('ShaDa support code', function()
     local tf_full = curbufmeths.get_name()
     nvim_command('edit ' .. testfilename_2)
     local tf_full_2 = curbufmeths.get_name()
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     local oldfiles = meths.get_vvar('oldfiles')
     table.sort(oldfiles)
@@ -145,7 +146,7 @@ describe('ShaDa support code', function()
     nvim_command('enew')
     nvim_command('normal! gg')
     local saved = exec_capture('jumps')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     eq(saved, exec_capture('jumps'))
   end)
@@ -176,7 +177,7 @@ describe('ShaDa support code', function()
     nvim_command('normal! G')
     nvim_command('sleep 2')
     nvim_command('normal! gg')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     nvim_command('redraw')
     nvim_command('edit ' .. testfilename)
@@ -200,7 +201,7 @@ describe('ShaDa support code', function()
     nvim_command('edit ' .. testfilename)
     nvim_command('normal! Gra')
     nvim_command('normal! ggrb')
-    nvim_command('qall!')
+    expect_exit(nvim_command, 'qall!')
     reset()
     nvim_command('edit ' .. testfilename)
     nvim_command('normal! Gg;')
diff --git a/test/functional/shada/registers_spec.lua b/test/functional/shada/registers_spec.lua
index 1f06cbe35..6aaa54cce 100644
--- a/test/functional/shada/registers_spec.lua
+++ b/test/functional/shada/registers_spec.lua
@@ -4,6 +4,7 @@ local nvim_command, funcs, eq = helpers.command, helpers.funcs, helpers.eq
 
 local shada_helpers = require('test.functional.shada.helpers')
 local reset, clear = shada_helpers.reset, shada_helpers.clear
+local expect_exit = helpers.expect_exit
 
 local setreg = function(name, contents, typ)
   if type(contents) == 'string' then
@@ -27,7 +28,7 @@ describe('ShaDa support code', function()
     setreg('c', {'d', 'e', ''}, 'c')
     setreg('l', {'a', 'b', 'cde'}, 'l')
     setreg('b', {'bca', 'abc', 'cba'}, 'b3')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     eq({{'d', 'e', ''}, 'v'}, getreg('c'))
     eq({{'a', 'b', 'cde'}, 'V'}, getreg('l'))
@@ -39,7 +40,7 @@ describe('ShaDa support code', function()
     setreg('c', {'d', 'e', ''}, 'c')
     setreg('l', {'a', 'b', 'cde'}, 'l')
     setreg('b', {'bca', 'abc', 'cba'}, 'b3')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     eq({{}, ''}, getreg('c'))
     eq({{}, ''}, getreg('l'))
@@ -50,7 +51,7 @@ describe('ShaDa support code', function()
     setreg('c', {'d', 'e', ''}, 'c')
     setreg('l', {'a', 'b', 'cde'}, 'l')
     setreg('b', {'bca', 'abc', 'cba'}, 'b3')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset('set shada=\'0,<0')
     eq({{'d', 'e', ''}, 'v'}, getreg('c'))
     eq({{'a', 'b', 'cde'}, 'V'}, getreg('l'))
@@ -62,7 +63,7 @@ describe('ShaDa support code', function()
     setreg('c', {'d', 'e', ''}, 'c')
     setreg('l', {'a', 'b', 'cde'}, 'l')
     setreg('b', {'bca', 'abc', 'cba'}, 'b3')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     eq({{}, ''}, getreg('c'))
     eq({{}, ''}, getreg('l'))
@@ -73,7 +74,7 @@ describe('ShaDa support code', function()
     setreg('c', {'d', 'e', ''}, 'c')
     setreg('l', {'a', 'b', 'cde'}, 'l')
     setreg('b', {'bca', 'abc', 'cba'}, 'b3')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset('set shada=\'0,\\"0')
     eq({{'d', 'e', ''}, 'v'}, getreg('c'))
     eq({{'a', 'b', 'cde'}, 'V'}, getreg('l'))
@@ -85,7 +86,7 @@ describe('ShaDa support code', function()
     setreg('c', {'d', 'e', ''}, 'c')
     setreg('l', {'a', 'b', 'cde'}, 'l')
     setreg('b', {'bca', 'abc', 'cba'}, 'b3')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     eq({{'d', 'e', ''}, 'v'}, getreg('c'))
     eq({{'a', 'b', 'cde'}, 'V'}, getreg('l'))
@@ -96,7 +97,7 @@ describe('ShaDa support code', function()
     nvim_command('set shada=\'0,<2')
     setreg('o', {'d'}, 'c')
     setreg('t', {'a', 'b', 'cde'}, 'l')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     eq({{'d'}, 'v'}, getreg('o'))
     eq({{}, ''}, getreg('t'))
@@ -106,7 +107,7 @@ describe('ShaDa support code', function()
     nvim_command('set shada=\'0,\\"2')
     setreg('o', {'d'}, 'c')
     setreg('t', {'a', 'b', 'cde'}, 'l')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     eq({{'d'}, 'v'}, getreg('o'))
     eq({{}, ''}, getreg('t'))
@@ -117,7 +118,7 @@ describe('ShaDa support code', function()
     setreg('o', {'d'}, 'c')
     setreg('t', {'a', 'b', 'cde'}, 'l')
     setreg('h', {'abc', 'acb', 'bac', 'bca', 'cab', 'cba'}, 'b3')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     eq({{'d'}, 'v'}, getreg('o'))
     eq({{'a', 'b', 'cde'}, 'V'}, getreg('t'))
@@ -128,7 +129,7 @@ describe('ShaDa support code', function()
   function()
     reset()
     setreg('e', {'«'}, 'c')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     eq({{'«'}, 'v'}, getreg('e'))
   end)
@@ -138,7 +139,7 @@ describe('ShaDa support code', function()
     reset()
     -- \171 is U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK in latin1
     setreg('e', {'\171«'}, 'c')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     eq({{'\171«'}, 'v'}, getreg('e'))
   end)
@@ -148,7 +149,7 @@ describe('ShaDa support code', function()
     setreg('1', {'one'}, 'c')
     setreg('2', {'two'}, 'c')
     setreg('a', {'a'}, 'c')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     eq({{}, ''}, getreg('0'))
     eq({{'one'}, 'v'}, getreg('1'))
@@ -161,7 +162,7 @@ describe('ShaDa support code', function()
     setreg('0', {'zero'}, 'c')
     setreg('1', {'one'}, 'c')
     setreg('2', {'two'}, 'c')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     eq({{'zero'}, 'v'}, getreg('0'))
     eq({{'one'}, 'v'}, getreg('1'))
@@ -173,7 +174,7 @@ describe('ShaDa support code', function()
     setreg('0', {'zero'}, 'c')
     setreg('1', {'one'}, 'cu')
     setreg('2', {'two'}, 'c')
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     eq({{'zero'}, 'v'}, getreg('0'))
     eq({{'one'}, 'v'}, getreg('1'))
diff --git a/test/functional/shada/variables_spec.lua b/test/functional/shada/variables_spec.lua
index 854add136..a91b7eb19 100644
--- a/test/functional/shada/variables_spec.lua
+++ b/test/functional/shada/variables_spec.lua
@@ -2,6 +2,7 @@
 local helpers = require('test.functional.helpers')(after_each)
 local meths, funcs, nvim_command, eq, eval =
   helpers.meths, helpers.funcs, helpers.command, helpers.eq, helpers.eval
+local expect_exit = helpers.expect_exit
 
 local shada_helpers = require('test.functional.shada.helpers')
 local reset, clear = shada_helpers.reset, shada_helpers.clear
@@ -33,7 +34,7 @@ describe('ShaDa support code', function()
       local vartype = eval('type(g:' .. varname .. ')')
       -- Exit during `reset` is not a regular exit: it does not write shada
       -- automatically
-      nvim_command('qall')
+      expect_exit(nvim_command, 'qall')
       reset('set shada+=!')
       eq(vartype, eval('type(g:' .. varname .. ')'))
       eq(varval, meths.get_var(varname))
@@ -98,7 +99,7 @@ describe('ShaDa support code', function()
     meths.set_var('LSTVAR', {'«'})
     meths.set_var('DCTVAR', {['«']='«'})
     meths.set_var('NESTEDVAR', {['«']={{'«'}, {['«']='«'}, {a='Test'}}})
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     eq('«', meths.get_var('STRVAR'))
     eq({'«'}, meths.get_var('LSTVAR'))
@@ -116,7 +117,7 @@ describe('ShaDa support code', function()
     meths.set_var('DCTVAR', {['«\171']='«\171'})
     meths.set_var('NESTEDVAR', {['\171']={{'\171«'}, {['\171']='\171'},
                                 {a='Test'}}})
-    nvim_command('qall')
+    expect_exit(nvim_command, 'qall')
     reset()
     eq('\171', meths.get_var('STRVAR'))
     eq({'\171'}, meths.get_var('LSTVAR'))
diff --git a/test/functional/ui/syntax_conceal_spec.lua b/test/functional/ui/syntax_conceal_spec.lua
index 9d10c55cb..f79059714 100644
--- a/test/functional/ui/syntax_conceal_spec.lua
+++ b/test/functional/ui/syntax_conceal_spec.lua
@@ -4,6 +4,7 @@ local clear, feed, command = helpers.clear, helpers.feed, helpers.command
 local eq = helpers.eq
 local insert = helpers.insert
 local poke_eventloop = helpers.poke_eventloop
+local expect_exit = helpers.expect_exit
 
 describe('Screen', function()
   local screen
@@ -1003,7 +1004,7 @@ describe('Screen', function()
   -- test/functional/ui/syntax_conceal_spec.lua.
   describe('concealed line after window scroll', function()
     after_each(function()
-      command(':qall!')
+      expect_exit(command, ':qall!')
       os.remove('Xcolesearch')
     end)
 
diff --git a/third-party/cmake/BuildLuarocks.cmake b/third-party/cmake/BuildLuarocks.cmake
index 065027d86..6933d263f 100644
--- a/third-party/cmake/BuildLuarocks.cmake
+++ b/third-party/cmake/BuildLuarocks.cmake
@@ -219,7 +219,7 @@ if(USE_BUNDLED_BUSTED)
   # nvim-client: https://github.com/neovim/lua-client
   add_custom_command(OUTPUT ${ROCKS_DIR}/nvim-client
     COMMAND ${LUAROCKS_BINARY}
-    ARGS build nvim-client 0.2.2-1 ${LUAROCKS_BUILDARGS}
+    ARGS build nvim-client 0.2.4-1 ${LUAROCKS_BUILDARGS}
     DEPENDS luv)
   add_custom_target(nvim-client DEPENDS ${ROCKS_DIR}/nvim-client)