aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-01-23 20:46:27 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-01-23 20:46:27 -0300
commit8a363360dc8206f7d5685e9eb036af12678d656c (patch)
tree4215d900d0ae75e0ee150dfad9cfdc21d0da286d /test
parentd84cbfa4dc8b6d1ba7b9c72ad7fb9c40e05ae1d9 (diff)
downloadrneovim-8a363360dc8206f7d5685e9eb036af12678d656c.tar.gz
rneovim-8a363360dc8206f7d5685e9eb036af12678d656c.tar.bz2
rneovim-8a363360dc8206f7d5685e9eb036af12678d656c.zip
test: Migrate legacy test 107
This test depends on terminal size to work correctly. After migration this requirement is removed.
Diffstat (limited to 'test')
-rw-r--r--test/functional/legacy/107_adjust_window_and_contents_spec.lua59
1 files changed, 59 insertions, 0 deletions
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! \<C-W>t\<C-W>=1Gzt\<C-W>w\<C-W>+"]])
+ execute('let s3=GetScreenStr(1)')
+ execute('wincmd p')
+ execute('call add(r, [line("w0"), s3])')
+ execute([[exe ":norm! \<C-W>t\<C-W>=50Gzt\<C-W>w\<C-W>+"]])
+ execute('let s3=GetScreenStr(1)')
+ execute('wincmd p')
+ execute('call add(r, [line("w0"), s3])')
+ execute([[exe ":norm! \<C-W>t\<C-W>=59Gzt\<C-W>w\<C-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)