From 8a363360dc8206f7d5685e9eb036af12678d656c Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Fri, 23 Jan 2015 20:46:27 -0300 Subject: [PATCH] test: Migrate legacy test 107 This test depends on terminal size to work correctly. After migration this requirement is removed. --- src/nvim/testdir/test107.in | 38 ------------ src/nvim/testdir/test107.ok | 4 -- .../107_adjust_window_and_contents_spec.lua | 59 +++++++++++++++++++ 3 files changed, 59 insertions(+), 42 deletions(-) delete mode 100644 src/nvim/testdir/test107.in delete mode 100644 src/nvim/testdir/test107.ok create mode 100644 test/functional/legacy/107_adjust_window_and_contents_spec.lua diff --git a/src/nvim/testdir/test107.in b/src/nvim/testdir/test107.in deleted file mode 100644 index 9143380f18..0000000000 --- a/src/nvim/testdir/test107.in +++ /dev/null @@ -1,38 +0,0 @@ -Tests for adjusting window and contents vim: set ft=vim : - -STARTTEST -:so small.vim -:new -:call setline(1, range(1,256)) -:let r=[] -:func! GetScreenStr(row) -: let str = "" -: for c in range(1,3) -: let str .= nr2char(screenchar(a:row, c)) -: endfor -: return str -:endfunc -: -:exe ":norm! \t\=1Gzt\w\+" -:let s3=GetScreenStr(1) -:wincmd p -:call add(r, [line("w0"), s3]) -: -:exe ":norm! \t\=50Gzt\w\+" -:let s3=GetScreenStr(1) -:wincmd p -:call add(r, [line("w0"), s3]) -: -:exe ":norm! \t\=59Gzt\w\+" -:let s3=GetScreenStr(1) -::wincmd p -:call add(r, [line("w0"), s3]) -: -:bwipeout! -:$put=r -:call garbagecollect(1) -:" -:/^start:/,$wq! test.out -ENDTEST - -start: diff --git a/src/nvim/testdir/test107.ok b/src/nvim/testdir/test107.ok deleted file mode 100644 index 3e0eda1fe7..0000000000 --- a/src/nvim/testdir/test107.ok +++ /dev/null @@ -1,4 +0,0 @@ -start: -[1, '1 '] -[50, '50 '] -[59, '59 '] diff --git a/test/functional/legacy/107_adjust_window_and_contents_spec.lua b/test/functional/legacy/107_adjust_window_and_contents_spec.lua new file mode 100644 index 0000000000..ffc2208d6e --- /dev/null +++ b/test/functional/legacy/107_adjust_window_and_contents_spec.lua @@ -0,0 +1,59 @@ +-- Tests for adjusting window and contents + +local helpers = require('test.functional.helpers') +local Screen = require('test.functional.ui.screen') +local feed, insert, source = helpers.feed, helpers.insert, helpers.source +local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect + +describe('107', function() + setup(clear) + + it('is working', function() + local screen = Screen.new() + screen:attach() + + insert('start:') + execute('new') + execute('call setline(1, range(1,256))') + execute('let r=[]') + execute('func! GetScreenStr(row)') + execute(' let str = ""') + execute(' for c in range(1,3)') + execute(' let str .= nr2char(screenchar(a:row, c))') + execute(' endfor') + execute(' return str') + execute('endfunc') + execute([[exe ":norm! \t\=1Gzt\w\+"]]) + execute('let s3=GetScreenStr(1)') + execute('wincmd p') + execute('call add(r, [line("w0"), s3])') + execute([[exe ":norm! \t\=50Gzt\w\+"]]) + execute('let s3=GetScreenStr(1)') + execute('wincmd p') + execute('call add(r, [line("w0"), s3])') + execute([[exe ":norm! \t\=59Gzt\w\+"]]) + execute('let s3=GetScreenStr(1)') + execute(':wincmd p') + execute('call add(r, [line("w0"), s3])') + execute('bwipeout!') + execute('$put=r') + execute('call garbagecollect(1)') + + screen:expect([[ + start: | + [1, '1 '] | + [50, '50 '] | + ^59, '59 '] | + ~ | + ~ | + ~ | + ~ | + ~ | + ~ | + ~ | + ~ | + ~ | + :call garbagecollect(1) | + ]]) + end) +end)