diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/plugin/shada_spec.lua | 509 | ||||
-rw-r--r-- | test/functional/ui/float_spec.lua | 329 |
2 files changed, 578 insertions, 260 deletions
diff --git a/test/functional/plugin/shada_spec.lua b/test/functional/plugin/shada_spec.lua index d96b479a62..5663f248bf 100644 --- a/test/functional/plugin/shada_spec.lua +++ b/test/functional/plugin/shada_spec.lua @@ -12,9 +12,7 @@ local shada_helpers = require('test.functional.shada.helpers') local get_shada_rw = shada_helpers.get_shada_rw local function reset(shada_file) - clear{ args={'-u', 'NORC', - '-i', shada_file or 'NONE', - }} + clear{ args={'-u', 'NORC', '-i', shada_file or 'NONE', }} end local mpack_eq = function(expected, mpack_result) @@ -2143,7 +2141,7 @@ describe('plugin/shada.vim', function() local epoch = os.date('%Y-%m-%dT%H:%M:%S', 0) local eol = helpers.iswin() and '\r\n' or '\n' before_each(function() - reset() + -- Note: reset() is called explicitly in each test. os.remove(fname) os.remove(fname .. '.tst') os.remove(fname_tmp) @@ -2159,272 +2157,263 @@ describe('plugin/shada.vim', function() mpack_eq(expected, mpack_result) end - describe('event BufReadCmd', function() - it('works', function() - wshada('\004\000\009\147\000\196\002ab\196\001a') - wshada_tmp('\004\000\009\147\000\196\002ab\196\001b') - nvim_command('edit ' .. fname) - eq({ - 'History entry with timestamp ' .. epoch .. ':', - ' @ Description_ Value', - ' - history type CMD', - ' - contents "ab"', - ' - "a"', - }, nvim_eval('getline(1, "$")')) - eq(false, curbuf('get_option', 'modified')) - eq('shada', curbuf('get_option', 'filetype')) - nvim_command('edit ' .. fname_tmp) - eq({ - 'History entry with timestamp ' .. epoch .. ':', - ' @ Description_ Value', - ' - history type CMD', - ' - contents "ab"', - ' - "b"', - }, nvim_eval('getline(1, "$")')) - eq(false, curbuf('get_option', 'modified')) - eq('shada', curbuf('get_option', 'filetype')) - eq('++opt not supported', exc_exec('edit ++enc=latin1 ' .. fname)) - neq({ - 'History entry with timestamp ' .. epoch .. ':', - ' @ Description_ Value', - ' - history type CMD', - ' - contents "ab"', - ' - "a"', - }, nvim_eval('getline(1, "$")')) - neq(true, curbuf('get_option', 'modified')) - end) + it('event BufReadCmd', function() + reset() + wshada('\004\000\009\147\000\196\002ab\196\001a') + wshada_tmp('\004\000\009\147\000\196\002ab\196\001b') + nvim_command('edit ' .. fname) + eq({ + 'History entry with timestamp ' .. epoch .. ':', + ' @ Description_ Value', + ' - history type CMD', + ' - contents "ab"', + ' - "a"', + }, nvim_eval('getline(1, "$")')) + eq(false, curbuf('get_option', 'modified')) + eq('shada', curbuf('get_option', 'filetype')) + nvim_command('edit ' .. fname_tmp) + eq({ + 'History entry with timestamp ' .. epoch .. ':', + ' @ Description_ Value', + ' - history type CMD', + ' - contents "ab"', + ' - "b"', + }, nvim_eval('getline(1, "$")')) + eq(false, curbuf('get_option', 'modified')) + eq('shada', curbuf('get_option', 'filetype')) + eq('++opt not supported', exc_exec('edit ++enc=latin1 ' .. fname)) + neq({ + 'History entry with timestamp ' .. epoch .. ':', + ' @ Description_ Value', + ' - history type CMD', + ' - contents "ab"', + ' - "a"', + }, nvim_eval('getline(1, "$")')) + neq(true, curbuf('get_option', 'modified')) end) - describe('event FileReadCmd', function() - it('works', function() - wshada('\004\000\009\147\000\196\002ab\196\001a') - wshada_tmp('\004\000\009\147\000\196\002ab\196\001b') - nvim_command('$read ' .. fname) - eq({ - '', - 'History entry with timestamp ' .. epoch .. ':', - ' @ Description_ Value', - ' - history type CMD', - ' - contents "ab"', - ' - "a"', - }, nvim_eval('getline(1, "$")')) - eq(true, curbuf('get_option', 'modified')) - neq('shada', curbuf('get_option', 'filetype')) - nvim_command('1,$read ' .. fname_tmp) - eq({ - '', - 'History entry with timestamp ' .. epoch .. ':', - ' @ Description_ Value', - ' - history type CMD', - ' - contents "ab"', - ' - "a"', - 'History entry with timestamp ' .. epoch .. ':', - ' @ Description_ Value', - ' - history type CMD', - ' - contents "ab"', - ' - "b"', - }, nvim_eval('getline(1, "$")')) - eq(true, curbuf('get_option', 'modified')) - neq('shada', curbuf('get_option', 'filetype')) - curbuf('set_option', 'modified', false) - eq('++opt not supported', exc_exec('$read ++enc=latin1 ' .. fname)) - eq({ - '', - 'History entry with timestamp ' .. epoch .. ':', - ' @ Description_ Value', - ' - history type CMD', - ' - contents "ab"', - ' - "a"', - 'History entry with timestamp ' .. epoch .. ':', - ' @ Description_ Value', - ' - history type CMD', - ' - contents "ab"', - ' - "b"', - }, nvim_eval('getline(1, "$")')) - neq(true, curbuf('get_option', 'modified')) - end) + it('event FileReadCmd', function() + reset() + wshada('\004\000\009\147\000\196\002ab\196\001a') + wshada_tmp('\004\000\009\147\000\196\002ab\196\001b') + nvim_command('$read ' .. fname) + eq({ + '', + 'History entry with timestamp ' .. epoch .. ':', + ' @ Description_ Value', + ' - history type CMD', + ' - contents "ab"', + ' - "a"', + }, nvim_eval('getline(1, "$")')) + eq(true, curbuf('get_option', 'modified')) + neq('shada', curbuf('get_option', 'filetype')) + nvim_command('1,$read ' .. fname_tmp) + eq({ + '', + 'History entry with timestamp ' .. epoch .. ':', + ' @ Description_ Value', + ' - history type CMD', + ' - contents "ab"', + ' - "a"', + 'History entry with timestamp ' .. epoch .. ':', + ' @ Description_ Value', + ' - history type CMD', + ' - contents "ab"', + ' - "b"', + }, nvim_eval('getline(1, "$")')) + eq(true, curbuf('get_option', 'modified')) + neq('shada', curbuf('get_option', 'filetype')) + curbuf('set_option', 'modified', false) + eq('++opt not supported', exc_exec('$read ++enc=latin1 ' .. fname)) + eq({ + '', + 'History entry with timestamp ' .. epoch .. ':', + ' @ Description_ Value', + ' - history type CMD', + ' - contents "ab"', + ' - "a"', + 'History entry with timestamp ' .. epoch .. ':', + ' @ Description_ Value', + ' - history type CMD', + ' - contents "ab"', + ' - "b"', + }, nvim_eval('getline(1, "$")')) + neq(true, curbuf('get_option', 'modified')) end) - describe('event BufWriteCmd', function() - it('works', function() - nvim('set_var', 'shada#add_own_header', 0) - curbuf('set_lines', 0, 1, true, { - 'Jump with timestamp ' .. epoch .. ':', - ' % Key________ Description Value', - ' + n name \'A\'', - ' + f file name ["foo"]', - ' + l line number 2', - ' + c column -200', - 'Jump with timestamp ' .. epoch .. ':', - ' % Key________ Description Value', - ' + n name \'A\'', - ' + f file name ["foo"]', - ' + l line number 2', - ' + c column -200', - }) - nvim_command('w ' .. fname .. '.tst') - nvim_command('w ' .. fname) - nvim_command('w ' .. fname_tmp) - eq('++opt not supported', exc_exec('w! ++enc=latin1 ' .. fname)) - eq(table.concat({ - 'Jump with timestamp ' .. epoch .. ':', - ' % Key________ Description Value', - ' + n name \'A\'', - ' + f file name ["foo"]', - ' + l line number 2', - ' + c column -200', - 'Jump with timestamp ' .. epoch .. ':', - ' % Key________ Description Value', - ' + n name \'A\'', - ' + f file name ["foo"]', - ' + l line number 2', - ' + c column -200', - }, eol) .. eol, read_file(fname .. '.tst')) - shada_eq({{ - timestamp=0, - type=8, - value={c=-200, f={'foo'}, l=2, n=('A'):byte()}, - }, { - timestamp=0, - type=8, - value={c=-200, f={'foo'}, l=2, n=('A'):byte()}, - }}, fname) - shada_eq({{ - timestamp=0, - type=8, - value={c=-200, f={'foo'}, l=2, n=('A'):byte()}, - }, { - timestamp=0, - type=8, - value={c=-200, f={'foo'}, l=2, n=('A'):byte()}, - }}, fname_tmp) - end) + it('event BufWriteCmd', function() + reset() + nvim('set_var', 'shada#add_own_header', 0) + curbuf('set_lines', 0, 1, true, { + 'Jump with timestamp ' .. epoch .. ':', + ' % Key________ Description Value', + ' + n name \'A\'', + ' + f file name ["foo"]', + ' + l line number 2', + ' + c column -200', + 'Jump with timestamp ' .. epoch .. ':', + ' % Key________ Description Value', + ' + n name \'A\'', + ' + f file name ["foo"]', + ' + l line number 2', + ' + c column -200', + }) + nvim_command('w ' .. fname .. '.tst') + nvim_command('w ' .. fname) + nvim_command('w ' .. fname_tmp) + eq('++opt not supported', exc_exec('w! ++enc=latin1 ' .. fname)) + eq(table.concat({ + 'Jump with timestamp ' .. epoch .. ':', + ' % Key________ Description Value', + ' + n name \'A\'', + ' + f file name ["foo"]', + ' + l line number 2', + ' + c column -200', + 'Jump with timestamp ' .. epoch .. ':', + ' % Key________ Description Value', + ' + n name \'A\'', + ' + f file name ["foo"]', + ' + l line number 2', + ' + c column -200', + }, eol) .. eol, read_file(fname .. '.tst')) + shada_eq({{ + timestamp=0, + type=8, + value={c=-200, f={'foo'}, l=2, n=('A'):byte()}, + }, { + timestamp=0, + type=8, + value={c=-200, f={'foo'}, l=2, n=('A'):byte()}, + }}, fname) + shada_eq({{ + timestamp=0, + type=8, + value={c=-200, f={'foo'}, l=2, n=('A'):byte()}, + }, { + timestamp=0, + type=8, + value={c=-200, f={'foo'}, l=2, n=('A'):byte()}, + }}, fname_tmp) end) - describe('event FileWriteCmd', function() - it('works', function() - nvim('set_var', 'shada#add_own_header', 0) - curbuf('set_lines', 0, 1, true, { - 'Jump with timestamp ' .. epoch .. ':', - ' % Key________ Description Value', - ' + n name \'A\'', - ' + f file name ["foo"]', - ' + l line number 2', - ' + c column -200', - 'Jump with timestamp ' .. epoch .. ':', - ' % Key________ Description Value', - ' + n name \'A\'', - ' + f file name ["foo"]', - ' + l line number 2', - ' + c column -200', - }) - nvim_command('1,3w ' .. fname .. '.tst') - nvim_command('1,3w ' .. fname) - nvim_command('1,3w ' .. fname_tmp) - eq('++opt not supported', exc_exec('1,3w! ++enc=latin1 ' .. fname)) - eq(table.concat({ - 'Jump with timestamp ' .. epoch .. ':', - ' % Key________ Description Value', - ' + n name \'A\'', - }, eol) .. eol, read_file(fname .. '.tst')) - shada_eq({{ - timestamp=0, - type=8, - value={n=('A'):byte()}, - }}, fname) - shada_eq({{ - timestamp=0, - type=8, - value={n=('A'):byte()}, - }}, fname_tmp) - end) + it('event FileWriteCmd', function() + reset() + nvim('set_var', 'shada#add_own_header', 0) + curbuf('set_lines', 0, 1, true, { + 'Jump with timestamp ' .. epoch .. ':', + ' % Key________ Description Value', + ' + n name \'A\'', + ' + f file name ["foo"]', + ' + l line number 2', + ' + c column -200', + 'Jump with timestamp ' .. epoch .. ':', + ' % Key________ Description Value', + ' + n name \'A\'', + ' + f file name ["foo"]', + ' + l line number 2', + ' + c column -200', + }) + nvim_command('1,3w ' .. fname .. '.tst') + nvim_command('1,3w ' .. fname) + nvim_command('1,3w ' .. fname_tmp) + eq('++opt not supported', exc_exec('1,3w! ++enc=latin1 ' .. fname)) + eq(table.concat({ + 'Jump with timestamp ' .. epoch .. ':', + ' % Key________ Description Value', + ' + n name \'A\'', + }, eol) .. eol, read_file(fname .. '.tst')) + shada_eq({{ + timestamp=0, + type=8, + value={n=('A'):byte()}, + }}, fname) + shada_eq({{ + timestamp=0, + type=8, + value={n=('A'):byte()}, + }}, fname_tmp) end) - describe('event FileAppendCmd', function() - it('works', function() - nvim('set_var', 'shada#add_own_header', 0) - curbuf('set_lines', 0, 1, true, { - 'Jump with timestamp ' .. epoch .. ':', - ' % Key________ Description Value', - ' + n name \'A\'', - ' + f file name ["foo"]', - ' + l line number 2', - ' + c column -200', - 'Jump with timestamp ' .. epoch .. ':', - ' % Key________ Description Value', - ' + n name \'A\'', - ' + f file name ["foo"]', - ' + l line number 2', - ' + c column -200', - }) - funcs.writefile({''}, fname .. '.tst', 'b') - funcs.writefile({''}, fname, 'b') - funcs.writefile({''}, fname_tmp, 'b') - nvim_command('1,3w >> ' .. fname .. '.tst') - nvim_command('1,3w >> ' .. fname) - nvim_command('1,3w >> ' .. fname_tmp) - nvim_command('w >> ' .. fname .. '.tst') - nvim_command('w >> ' .. fname) - nvim_command('w >> ' .. fname_tmp) - eq('++opt not supported', exc_exec('1,3w! ++enc=latin1 >> ' .. fname)) - eq(table.concat({ - 'Jump with timestamp ' .. epoch .. ':', - ' % Key________ Description Value', - ' + n name \'A\'', - 'Jump with timestamp ' .. epoch .. ':', - ' % Key________ Description Value', - ' + n name \'A\'', - ' + f file name ["foo"]', - ' + l line number 2', - ' + c column -200', - 'Jump with timestamp ' .. epoch .. ':', - ' % Key________ Description Value', - ' + n name \'A\'', - ' + f file name ["foo"]', - ' + l line number 2', - ' + c column -200', - }, eol) .. eol, read_file(fname .. '.tst')) - shada_eq({{ - timestamp=0, - type=8, - value={n=('A'):byte()}, - }, { - timestamp=0, - type=8, - value={c=-200, f={'foo'}, l=2, n=('A'):byte()}, - }, { - timestamp=0, - type=8, - value={c=-200, f={'foo'}, l=2, n=('A'):byte()}, - }}, fname) - shada_eq({{ - timestamp=0, - type=8, - value={n=('A'):byte()}, - }, { - timestamp=0, - type=8, - value={c=-200, f={'foo'}, l=2, n=('A'):byte()}, - }, { - timestamp=0, - type=8, - value={c=-200, f={'foo'}, l=2, n=('A'):byte()}, - }}, fname_tmp) - end) + it('event FileAppendCmd', function() + reset() + nvim('set_var', 'shada#add_own_header', 0) + curbuf('set_lines', 0, 1, true, { + 'Jump with timestamp ' .. epoch .. ':', + ' % Key________ Description Value', + ' + n name \'A\'', + ' + f file name ["foo"]', + ' + l line number 2', + ' + c column -200', + 'Jump with timestamp ' .. epoch .. ':', + ' % Key________ Description Value', + ' + n name \'A\'', + ' + f file name ["foo"]', + ' + l line number 2', + ' + c column -200', + }) + funcs.writefile({''}, fname .. '.tst', 'b') + funcs.writefile({''}, fname, 'b') + funcs.writefile({''}, fname_tmp, 'b') + nvim_command('1,3w >> ' .. fname .. '.tst') + nvim_command('1,3w >> ' .. fname) + nvim_command('1,3w >> ' .. fname_tmp) + nvim_command('w >> ' .. fname .. '.tst') + nvim_command('w >> ' .. fname) + nvim_command('w >> ' .. fname_tmp) + eq('++opt not supported', exc_exec('1,3w! ++enc=latin1 >> ' .. fname)) + eq(table.concat({ + 'Jump with timestamp ' .. epoch .. ':', + ' % Key________ Description Value', + ' + n name \'A\'', + 'Jump with timestamp ' .. epoch .. ':', + ' % Key________ Description Value', + ' + n name \'A\'', + ' + f file name ["foo"]', + ' + l line number 2', + ' + c column -200', + 'Jump with timestamp ' .. epoch .. ':', + ' % Key________ Description Value', + ' + n name \'A\'', + ' + f file name ["foo"]', + ' + l line number 2', + ' + c column -200', + }, eol) .. eol, read_file(fname .. '.tst')) + shada_eq({{ + timestamp=0, + type=8, + value={n=('A'):byte()}, + }, { + timestamp=0, + type=8, + value={c=-200, f={'foo'}, l=2, n=('A'):byte()}, + }, { + timestamp=0, + type=8, + value={c=-200, f={'foo'}, l=2, n=('A'):byte()}, + }}, fname) + shada_eq({{ + timestamp=0, + type=8, + value={n=('A'):byte()}, + }, { + timestamp=0, + type=8, + value={c=-200, f={'foo'}, l=2, n=('A'):byte()}, + }, { + timestamp=0, + type=8, + value={c=-200, f={'foo'}, l=2, n=('A'):byte()}, + }}, fname_tmp) end) - describe('event SourceCmd', function() - before_each(function() - reset(fname) - end) - it('works', function() - wshada('\004\000\006\146\000\196\002ab') - wshada_tmp('\004\001\006\146\000\196\002bc') - eq(0, exc_exec('source ' .. fname)) - eq(0, exc_exec('source ' .. fname_tmp)) - eq('bc', funcs.histget(':', -1)) - eq('ab', funcs.histget(':', -2)) - end) + it('event SourceCmd', function() + reset(fname) + wshada('\004\000\006\146\000\196\002ab') + wshada_tmp('\004\001\006\146\000\196\002bc') + eq(0, exc_exec('source ' .. fname)) + eq(0, exc_exec('source ' .. fname_tmp)) + eq('bc', funcs.histget(':', -1)) + eq('ab', funcs.histget(':', -2)) end) end) diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 958c56334a..c8cf9d830e 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -963,6 +963,335 @@ describe('floating windows', function() end end) + it('can be placed relative text in a window', function() + screen:try_resize(30,5) + local firstwin = meths.get_current_win().id + meths.buf_set_lines(0, 0, -1, true, {'just some', 'example text that is wider than the window', '', '', 'more text'}) + if multigrid then + screen:expect{grid=[[ + ## grid 1 + [2:------------------------------]| + [2:------------------------------]| + [2:------------------------------]| + [2:------------------------------]| + [3:------------------------------]| + ## grid 2 + ^just some | + example text that is wider tha| + n the window | + | + ## grid 3 + | + ]]} + else + screen:expect{grid=[[ + ^just some | + example text that is wider tha| + n the window | + | + | + ]]} + end + + local buf = meths.create_buf(false,false) + meths.buf_set_lines(buf, 0, -1, true, {'some info!'}) + + local win = meths.open_win(buf, false, {relative='win', width=12, height=1, bufpos={1,32}}) + if multigrid then + screen:expect{grid=[[ + ## grid 1 + [2:------------------------------]| + [2:------------------------------]| + [2:------------------------------]| + [2:------------------------------]| + [3:------------------------------]| + ## grid 2 + ^just some | + example text that is wider tha| + n the window | + | + ## grid 3 + | + ## grid 5 + {1:some info! }| + ]], float_pos={ + [5] = { { + id = 1002 + }, "NW", 2, 3, 2, true } + }} + else + screen:expect{grid=[[ + ^just some | + example text that is wider tha| + n the window | + {1:some info! } | + | + ]]} + end + eq({relative='win', width=12, height=1, bufpos={1,32}, anchor='NW', + external=false, col=0, row=1, win=firstwin, focusable=true}, meths.win_get_config(win)) + + feed('<c-e>') + if multigrid then + screen:expect{grid=[[ + ## grid 1 + [2:------------------------------]| + [2:------------------------------]| + [2:------------------------------]| + [2:------------------------------]| + [3:------------------------------]| + ## grid 2 + ^example text that is wider tha| + n the window | + | + | + ## grid 3 + | + ## grid 5 + {1:some info! }| + ]], float_pos={ + [5] = { { + id = 1002 + }, "NW", 2, 2, 2, true } + }} + else + screen:expect{grid=[[ + ^example text that is wider tha| + n the window | + {1:some info! } | + | + | + ]]} + end + + + screen:try_resize(45,5) + if multigrid then + screen:expect{grid=[[ + ## grid 1 + [2:---------------------------------------------]| + [2:---------------------------------------------]| + [2:---------------------------------------------]| + [2:---------------------------------------------]| + [3:---------------------------------------------]| + ## grid 2 + ^example text that is wider than the window | + | + | + more text | + ## grid 3 + | + ## grid 5 + {1:some info! }| + ]], float_pos={ + [5] = { { + id = 1002 + }, "NW", 2, 1, 32, true } + }} + else + -- note: appears misalinged due to cursor + screen:expect{grid=[[ + ^example text that is wider than the window | + {1:some info! } | + | + more text | + | + ]]} + end + + screen:try_resize(25,10) + if multigrid then + screen:expect{grid=[[ + ## grid 1 + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [3:-------------------------]| + ## grid 2 + ^example text that is wide| + r than the window | + | + | + more text | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + ## grid 3 + | + ## grid 5 + {1:some info! }| + ]], float_pos={ + [5] = { { + id = 1002 + }, "NW", 2, 2, 7, true } + }} + else + screen:expect{grid=[[ + ^example text that is wide| + r than the window | + {1:some info! } | + | + more text | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + | + ]]} + end + + meths.win_set_config(win, {relative='win', bufpos={1,32}, anchor='SW'}) + if multigrid then + screen:expect{grid=[[ + ## grid 1 + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [3:-------------------------]| + ## grid 2 + ^example text that is wide| + r than the window | + | + | + more text | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + ## grid 3 + | + ## grid 5 + {1:some info! }| + ]], float_pos={ + [5] = { { + id = 1002 + }, "SW", 2, 1, 7, true } + }} + else + screen:expect{grid=[[ + ^example{1:some info! }s wide| + r than the window | + | + | + more text | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + | + ]]} + end + + meths.win_set_config(win, {relative='win', bufpos={1,32}, anchor='NW', col=-2}) + if multigrid then + screen:expect{grid=[[ + ## grid 1 + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [3:-------------------------]| + ## grid 2 + ^example text that is wide| + r than the window | + | + | + more text | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + ## grid 3 + | + ## grid 5 + {1:some info! }| + ]], float_pos={ + [5] = { { + id = 1002 + }, "NW", 2, 2, 5, true } + }} + else + screen:expect{grid=[[ + ^example text that is wide| + r than the window | + {1:some info! } | + | + more text | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + | + ]]} + end + + meths.win_set_config(win, {relative='win', bufpos={1,32}, row=2}) + if multigrid then + screen:expect{grid=[[ + ## grid 1 + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [2:-------------------------]| + [3:-------------------------]| + ## grid 2 + ^example text that is wide| + r than the window | + | + | + more text | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + ## grid 3 + | + ## grid 5 + {1:some info! }| + ]], float_pos={ + [5] = { { + id = 1002 + }, "NW", 2, 3, 7, true } + }} + else + screen:expect{grid=[[ + ^example text that is wide| + r than the window | + | + {1:some info! } | + more text | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + | + ]]} + end + end) + it('validates cursor even when window is not entered', function() screen:try_resize(30,5) command("set nowrap") |