aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/testdir/test98.in43
-rw-r--r--src/nvim/testdir/test98.ok1
-rw-r--r--test/functional/legacy/098_scrollbind_spec.lua48
3 files changed, 48 insertions, 44 deletions
diff --git a/src/nvim/testdir/test98.in b/src/nvim/testdir/test98.in
deleted file mode 100644
index 83ccba09e9..0000000000
--- a/src/nvim/testdir/test98.in
+++ /dev/null
@@ -1,43 +0,0 @@
-Test for 'scrollbind' causing an unexpected scroll of one of the windows.
-STARTTEST
-:so small.vim
-:" We don't want the status line to cause problems:
-:set laststatus=0
-:let g:totalLines = &lines * 20
-:let middle = g:totalLines / 2
-:wincmd n
-:wincmd o
-:for i in range(1, g:totalLines)
-: call setline(i, 'LINE ' . i)
-:endfor
-:exe string(middle)
-:normal zt
-:normal M
-:aboveleft vert new
-:for i in range(1, g:totalLines)
-: call setline(i, 'line ' . i)
-:endfor
-:exe string(middle)
-:normal zt
-:normal M
-:" Execute the following two command at once to reproduce the problem.
-:setl scb | wincmd p
-:setl scb
-:wincmd w
-:let topLineLeft = line('w0')
-:wincmd p
-:let topLineRight = line('w0')
-:setl noscrollbind
-:wincmd p
-:setl noscrollbind
-:q!
-:%del _
-:call setline(1, 'Difference between the top lines (left - right): ' . string(topLineLeft - topLineRight))
-:w! test.out
-:brewind
-ENDTEST
-
-STARTTEST
-:qa!
-ENDTEST
-
diff --git a/src/nvim/testdir/test98.ok b/src/nvim/testdir/test98.ok
deleted file mode 100644
index 356ddd8eac..0000000000
--- a/src/nvim/testdir/test98.ok
+++ /dev/null
@@ -1 +0,0 @@
-Difference between the top lines (left - right): 0
diff --git a/test/functional/legacy/098_scrollbind_spec.lua b/test/functional/legacy/098_scrollbind_spec.lua
new file mode 100644
index 0000000000..7b2059e38b
--- /dev/null
+++ b/test/functional/legacy/098_scrollbind_spec.lua
@@ -0,0 +1,48 @@
+-- Test for 'scrollbind' causing an unexpected scroll of one of the windows.
+
+local helpers = require('test.functional.helpers')
+local feed, insert, source = helpers.feed, helpers.insert, helpers.source
+local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect
+
+describe('scrollbind', function()
+ setup(clear)
+
+ it('is working', function()
+ source([[
+ set laststatus=0
+ let g:totalLines = &lines * 20
+ let middle = g:totalLines / 2
+ wincmd n
+ wincmd o
+ for i in range(1, g:totalLines)
+ call setline(i, 'LINE ' . i)
+ endfor
+ exe string(middle)
+ normal zt
+ normal M
+ aboveleft vert new
+ for i in range(1, g:totalLines)
+ call setline(i, 'line ' . i)
+ endfor
+ exe string(middle)
+ normal zt
+ normal M
+ setl scb | wincmd p
+ setl scb
+ wincmd w
+ let topLineLeft = line('w0')
+ wincmd p
+ let topLineRight = line('w0')
+ setl noscrollbind
+ wincmd p
+ setl noscrollbind
+ q!
+ %del _
+ call setline(1, 'Difference between the top lines (left - right): ' . string(topLineLeft - topLineRight))
+ brewind
+ ]])
+
+ -- Assert buffer contents.
+ expect("Difference between the top lines (left - right): 0")
+ end)
+end)