options_spec.lua 1.9 KB

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