From 72dfd57e5f45357db36155b79d7873cd0fc3dfaf Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 19 Jul 2022 19:36:29 +0800 Subject: test: deal with RPC call causing Nvim to exit later --- test/functional/legacy/arglist_spec.lua | 3 ++- test/functional/legacy/excmd_spec.lua | 11 ++++------- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'test/functional/legacy') diff --git a/test/functional/legacy/arglist_spec.lua b/test/functional/legacy/arglist_spec.lua index 8379e426e0..f90da16d7b 100644 --- a/test/functional/legacy/arglist_spec.lua +++ b/test/functional/legacy/arglist_spec.lua @@ -4,6 +4,7 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local clear, command, eq = helpers.clear, helpers.command, helpers.eq local eval, exc_exec, neq = helpers.eval, helpers.exc_exec, helpers.neq +local expect_exit = helpers.expect_exit local feed = helpers.feed local pcall_err = helpers.pcall_err @@ -275,6 +276,6 @@ describe('argument list commands', function() 2 more files to edit. Quit anyway? | [Y]es, (N)o: ^ | ]]) - feed('Y') + expect_exit(100, feed, 'Y') end) end) diff --git a/test/functional/legacy/excmd_spec.lua b/test/functional/legacy/excmd_spec.lua index 802e06c799..65957d85de 100644 --- a/test/functional/legacy/excmd_spec.lua +++ b/test/functional/legacy/excmd_spec.lua @@ -4,11 +4,11 @@ local clear = helpers.clear local command = helpers.command local exec = helpers.exec local exec_lua = helpers.exec_lua +local expect_exit = helpers.expect_exit local feed = helpers.feed local funcs = helpers.funcs local iswin = helpers.iswin local meths = helpers.meths -local poke_eventloop = helpers.poke_eventloop local read_file = helpers.read_file local source = helpers.source local eq = helpers.eq @@ -94,8 +94,7 @@ describe(':confirm command dialog', function() {3:Save changes to "Xbar"?} | {3:[Y]es, (N)o, Save (A)ll, (D)iscard All, (C)ancel: }^ | ]]) - feed('A') - poke_eventloop() + expect_exit(100, feed, 'A') eq('foo2\n', read_file('Xfoo')) eq('bar2\n', read_file('Xbar')) @@ -133,8 +132,7 @@ describe(':confirm command dialog', function() {3:Save changes to "Xbar"?} | {3:[Y]es, (N)o, Save (A)ll, (D)iscard All, (C)ancel: }^ | ]]) - feed('D') - poke_eventloop() + expect_exit(100, feed, 'D') eq('foo2\n', read_file('Xfoo')) eq('bar2\n', read_file('Xbar')) @@ -195,8 +193,7 @@ describe(':confirm command dialog', function() {3:Save changes to "Xfoo"?} | {3:[Y]es, (N)o, (C)ancel: }^ | ]]) - feed('Y') - poke_eventloop() + expect_exit(100, feed, 'Y') eq('foo4\n', read_file('Xfoo')) eq('bar2\n', read_file('Xbar')) -- cgit