aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/interrupt_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2021-09-17 09:16:40 -0700
committerGitHub <noreply@github.com>2021-09-17 09:16:40 -0700
commitd8de4eb685e35646c7d541e9a75bdc296127b7e2 (patch)
tree4bb05ec713856715ac9ba57e5d116eed344511b9 /test/functional/eval/interrupt_spec.lua
parentd56002f7b722facd97b0958e141c8ed2d01495f7 (diff)
downloadrneovim-d8de4eb685e35646c7d541e9a75bdc296127b7e2.tar.gz
rneovim-d8de4eb685e35646c7d541e9a75bdc296127b7e2.tar.bz2
rneovim-d8de4eb685e35646c7d541e9a75bdc296127b7e2.zip
test: reorg #15698
Problem: Subdirectories like "visual", "insert", "normal" encourage people to separate *related* tests for no good reason. Typically the _mode_ is not the relevant topic of a test (and when it is, _then_ create an appropriate describe() or it()). Solution: - Delete the various `test/functional/<mode>/` subdirectories, move their tests to more meaningful topics. - Rename `…/normal/` to `…/editor/`. - Move or merge `…/visual/*` and `…/insert/*` tests into here where appropriate. - Rename `…/eval/` to `…/vimscript/`. - Move `…/viml/*` into here also. * test(reorg): insert/* => editor/mode_insert_spec.lua * test(reorg): cmdline/* => editor/mode_cmdline_spec.lua * test(reorg): eval core tests => eval_spec.lua
Diffstat (limited to 'test/functional/eval/interrupt_spec.lua')
-rw-r--r--test/functional/eval/interrupt_spec.lua61
1 files changed, 0 insertions, 61 deletions
diff --git a/test/functional/eval/interrupt_spec.lua b/test/functional/eval/interrupt_spec.lua
deleted file mode 100644
index 05b1f4ff57..0000000000
--- a/test/functional/eval/interrupt_spec.lua
+++ /dev/null
@@ -1,61 +0,0 @@
-local helpers = require('test.functional.helpers')(after_each)
-
-local command = helpers.command
-local meths = helpers.meths
-local clear = helpers.clear
-local sleep = helpers.sleep
-local poke_eventloop = helpers.poke_eventloop
-local feed = helpers.feed
-local eq = helpers.eq
-
-local dur
-local min_dur = 8
-local len = 131072
-
-describe('List support code', function()
- if not pending('does not actually allows interrupting with just got_int', function() end) then return end
- -- The following tests are confirmed to work with os_breakcheck() just before
- -- `if (got_int) {break;}` in tv_list_copy and list_join_inner() and not to
- -- work without.
- setup(function()
- clear()
- dur = 0
- while true do
- command(([[
- let rt = reltime()
- let bl = range(%u)
- let dur = reltimestr(reltime(rt))
- ]]):format(len))
- dur = tonumber(meths.get_var('dur'))
- if dur >= min_dur then
- -- print(('Using len %u, dur %g'):format(len, dur))
- break
- else
- len = len * 2
- end
- end
- end)
- it('allows interrupting copy', function()
- feed(':let t_rt = reltime()<CR>:let t_bl = copy(bl)<CR>')
- sleep(min_dur / 16 * 1000)
- feed('<C-c>')
- poke_eventloop()
- command('let t_dur = reltimestr(reltime(t_rt))')
- local t_dur = tonumber(meths.get_var('t_dur'))
- if t_dur >= dur / 8 then
- eq(nil, ('Took too long to cancel: %g >= %g'):format(t_dur, dur / 8))
- end
- end)
- it('allows interrupting join', function()
- feed(':let t_rt = reltime()<CR>:let t_j = join(bl)<CR>')
- sleep(min_dur / 16 * 1000)
- feed('<C-c>')
- poke_eventloop()
- command('let t_dur = reltimestr(reltime(t_rt))')
- local t_dur = tonumber(meths.get_var('t_dur'))
- print(('t_dur: %g'):format(t_dur))
- if t_dur >= dur / 8 then
- eq(nil, ('Took too long to cancel: %g >= %g'):format(t_dur, dur / 8))
- end
- end)
-end)