neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

options_spec.lua (1983B)


      1 -- See also: test/old/testdir/test_options.vim
      2 local t = require('test.testutil')
      3 local n = require('test.functional.testnvim')()
      4 local Screen = require('test.functional.ui.screen')
      5 
      6 local command, clear = n.command, n.clear
      7 local source, expect = n.source, n.expect
      8 local exc_exec = n.exc_exec
      9 local matches = t.matches
     10 
     11 describe('options', function()
     12  setup(clear)
     13 
     14  it('should not throw any exception', function()
     15    command('options')
     16  end)
     17 end)
     18 
     19 describe('set', function()
     20  before_each(clear)
     21 
     22  it("should keep two comma when 'path' is changed", function()
     23    source([[
     24      set path=foo,,bar
     25      set path-=bar
     26      set path+=bar
     27      $put =&path]])
     28 
     29    expect([[
     30 
     31      foo,,bar]])
     32  end)
     33 
     34  it('winminheight works', function()
     35    local _ = Screen.new(20, 11)
     36    source([[
     37      set wmh=0 stal=2
     38      below sp | wincmd _
     39      below sp | wincmd _
     40      below sp | wincmd _
     41      below sp
     42    ]])
     43    matches('E36: Not enough room', exc_exec('set wmh=1'))
     44  end)
     45 
     46  it('winminheight works with tabline', function()
     47    local _ = Screen.new(20, 11)
     48    source([[
     49      set wmh=0 stal=2
     50      split
     51      split
     52      split
     53      split
     54      tabnew
     55    ]])
     56    matches('E36: Not enough room', exc_exec('set wmh=1'))
     57  end)
     58 
     59  it('scroll works', function()
     60    local screen = Screen.new(42, 16)
     61    source([[
     62      set scroll=2
     63      set laststatus=2
     64    ]])
     65    command('verbose set scroll?')
     66    screen:expect([[
     67                                                |
     68      {1:~                                         }|*11
     69      {3:                                          }|
     70        scroll=7                                |
     71              Last set from changed window size |
     72      {6:Press ENTER or type command to continue}^   |
     73    ]])
     74  end)
     75 
     76  it('foldcolumn and signcolumn to empty string is disallowed', function()
     77    matches('E474: Invalid argument: fdc=', exc_exec('set fdc='))
     78    matches('E474: Invalid argument: scl=', exc_exec('set scl='))
     79  end)
     80 end)