diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2018-02-13 21:57:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-13 21:57:15 +0100 |
commit | 0daa45bd4403211e893ea774121a36e206abe0ad (patch) | |
tree | da2298632595dc2d42c921a323ebd63978c27b82 /test/functional/ui | |
parent | 0f1bc5ddceb50ca8f96d91aabf8157d9758af0cd (diff) | |
parent | 6e5cb0debd23693175bd05409d3f1af4015567df (diff) | |
download | rneovim-0daa45bd4403211e893ea774121a36e206abe0ad.tar.gz rneovim-0daa45bd4403211e893ea774121a36e206abe0ad.tar.bz2 rneovim-0daa45bd4403211e893ea774121a36e206abe0ad.zip |
Merge pull request #7759 from bfredl/ext_options
ui: refactor external widget options
Diffstat (limited to 'test/functional/ui')
-rw-r--r-- | test/functional/ui/options_spec.lua | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/test/functional/ui/options_spec.lua b/test/functional/ui/options_spec.lua index bc72ca71aa..62b08c0967 100644 --- a/test/functional/ui/options_spec.lua +++ b/test/functional/ui/options_spec.lua @@ -10,7 +10,6 @@ describe('ui receives option updates', function() before_each(function() clear() screen = Screen.new(20,5) - screen:attach() end) after_each(function() @@ -27,15 +26,21 @@ describe('ui receives option updates', function() linespace=0, showtabline=1, termguicolors=false, + ext_cmdline=false, + ext_popupmenu=false, + ext_tabline=false, + ext_wildmenu=false, } it("for defaults", function() + screen:attach() screen:expect(function() eq(defaults, screen.options) end) end) it("when setting options", function() + screen:attach() local changed = {} for k,v in pairs(defaults) do changed[k] = v @@ -76,4 +81,30 @@ describe('ui receives option updates', function() eq(defaults, screen.options) end) end) + + it('with UI extensions', function() + local changed = {} + for k,v in pairs(defaults) do + changed[k] = v + end + + screen:attach({ext_cmdline=true, ext_wildmenu=true}) + changed.ext_cmdline = true + changed.ext_wildmenu = true + screen:expect(function() + eq(changed, screen.options) + end) + + screen:set_option('ext_popupmenu', true) + changed.ext_popupmenu = true + screen:expect(function() + eq(changed, screen.options) + end) + + screen:set_option('ext_wildmenu', false) + changed.ext_wildmenu = false + screen:expect(function() + eq(changed, screen.options) + end) + end) end) |