2015-01-23 16:46:27 -07:00
|
|
|
-- Tests for adjusting window and contents
|
|
|
|
|
2016-04-23 16:53:11 -07:00
|
|
|
local helpers = require('test.functional.helpers')(after_each)
|
2015-01-23 16:46:27 -07:00
|
|
|
local Screen = require('test.functional.ui.screen')
|
2017-04-08 14:12:26 -07:00
|
|
|
|
|
|
|
local wait = helpers.wait
|
|
|
|
local clear = helpers.clear
|
2015-11-17 14:44:00 -07:00
|
|
|
local insert = helpers.insert
|
2017-04-08 14:12:26 -07:00
|
|
|
local command = helpers.command
|
2015-01-23 16:46:27 -07:00
|
|
|
|
2016-08-15 16:42:12 -07:00
|
|
|
if helpers.pending_win32(pending) then return end
|
|
|
|
|
2015-01-23 16:46:27 -07:00
|
|
|
describe('107', function()
|
|
|
|
setup(clear)
|
|
|
|
|
|
|
|
it('is working', function()
|
|
|
|
local screen = Screen.new()
|
|
|
|
screen:attach()
|
|
|
|
|
|
|
|
insert('start:')
|
2017-04-08 14:12:26 -07:00
|
|
|
wait()
|
|
|
|
command('new')
|
|
|
|
command('call setline(1, range(1,256))')
|
|
|
|
command('let r=[]')
|
2017-04-08 16:10:08 -07:00
|
|
|
command([[
|
|
|
|
func! GetScreenStr(row)
|
|
|
|
let str = ""
|
|
|
|
for c in range(1,3)
|
|
|
|
let str .= nr2char(screenchar(a:row, c))
|
|
|
|
endfor
|
|
|
|
return str
|
|
|
|
endfunc
|
|
|
|
]])
|
2017-04-08 14:12:26 -07:00
|
|
|
command([[exe ":norm! \<C-W>t\<C-W>=1Gzt\<C-W>w\<C-W>+"]])
|
|
|
|
command('let s3=GetScreenStr(1)')
|
|
|
|
command('wincmd p')
|
|
|
|
command('call add(r, [line("w0"), s3])')
|
|
|
|
command([[exe ":norm! \<C-W>t\<C-W>=50Gzt\<C-W>w\<C-W>+"]])
|
|
|
|
command('let s3=GetScreenStr(1)')
|
|
|
|
command('wincmd p')
|
|
|
|
command('call add(r, [line("w0"), s3])')
|
|
|
|
command([[exe ":norm! \<C-W>t\<C-W>=59Gzt\<C-W>w\<C-W>+"]])
|
|
|
|
command('let s3=GetScreenStr(1)')
|
|
|
|
command(':wincmd p')
|
|
|
|
command('call add(r, [line("w0"), s3])')
|
|
|
|
command('bwipeout!')
|
|
|
|
command('$put=r')
|
|
|
|
command('call garbagecollect(1)')
|
2015-01-23 16:46:27 -07:00
|
|
|
|
|
|
|
screen:expect([[
|
|
|
|
start: |
|
|
|
|
[1, '1 '] |
|
|
|
|
[50, '50 '] |
|
2015-03-05 02:07:55 -07:00
|
|
|
^[59, '59 '] |
|
2015-01-23 16:46:27 -07:00
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
2017-04-08 16:10:08 -07:00
|
|
|
3 more lines |
|
2015-01-23 16:46:27 -07:00
|
|
|
]])
|
|
|
|
end)
|
|
|
|
end)
|