view src/testdir/test_scroll_opt.vim @ 20913:a127db33a075 v8.2.1008

patch 8.2.1008: Vim9: no test for disassambling newly added instructions Commit: https://github.com/vim/vim/commit/0779fab2979d6d055ba3c464f1c2b9d90dc9e49f Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 18 22:18:18 2020 +0200 patch 8.2.1008: Vim9: no test for disassambling newly added instructions Problem: Vim9: no test for disassambling newly added instructions. Solution: Add a function and check disassembly.
author Bram Moolenaar <Bram@vim.org>
date Thu, 18 Jun 2020 22:30:04 +0200
parents f8f505ffc0a6
children 08940efa6b4e
line wrap: on
line source

" Test for reset 'scroll'
"

func Test_reset_scroll()
  let scr = &l:scroll

  setlocal scroll=1
  setlocal scroll&
  call assert_equal(scr, &l:scroll)

  setlocal scroll=1
  setlocal scroll=0
  call assert_equal(scr, &l:scroll)

  try
    execute 'setlocal scroll=' . (winheight(0) + 1)
    " not reached
    call assert_false(1)
  catch
    call assert_exception('E49:')
  endtry

  split

  let scr = &l:scroll

  setlocal scroll=1
  setlocal scroll&
  call assert_equal(scr, &l:scroll)

  setlocal scroll=1
  setlocal scroll=0
  call assert_equal(scr, &l:scroll)

  quit!
endfunc