view src/testdir/test_scroll_opt.vim @ 19683:dd028abdde0f v8.2.0398

patch 8.2.0398: profile test fails when two functions take same time Commit: https://github.com/vim/vim/commit/a21df1db3ca619afdcb47931af042508a6bbc8e5 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Mar 17 20:57:09 2020 +0100 patch 8.2.0398: profile test fails when two functions take same time Problem: Profile test fails when two functions take same time. Solution: Add a short sleep in once function. (closes https://github.com/vim/vim/issues/5797)
author Bram Moolenaar <Bram@vim.org>
date Tue, 17 Mar 2020 21:00:06 +0100
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