diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-05-12 00:11:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-12 00:11:57 +0200 |
commit | ab7d9ae19356aa2b1a3c12a9846bc279d159e763 (patch) | |
tree | 5fe18e2e7b23ee8eba8bc0f7b0bdaa53046fa454 /test/functional/ui/screen.lua | |
parent | 7c9d4d971cab4525fb2245ec527736b4e9471e84 (diff) | |
parent | a0f775c4d3eedfb845d1254cae767a38a1c28b93 (diff) | |
download | rneovim-ab7d9ae19356aa2b1a3c12a9846bc279d159e763.tar.gz rneovim-ab7d9ae19356aa2b1a3c12a9846bc279d159e763.tar.bz2 rneovim-ab7d9ae19356aa2b1a3c12a9846bc279d159e763.zip |
Merge #9993 from justinmk/ui-message-kinds
UI/ext_messages: learn more message kinds
Diffstat (limited to 'test/functional/ui/screen.lua')
-rw-r--r-- | test/functional/ui/screen.lua | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index 983a2f3d40..53b6642207 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -74,6 +74,7 @@ local global_helpers = require('test.helpers') local deepcopy = global_helpers.deepcopy local shallowcopy = global_helpers.shallowcopy +local concat_tables = global_helpers.concat_tables local helpers = require('test.functional.helpers')(nil) local request, run_session = helpers.request, helpers.run_session local eq = helpers.eq @@ -413,26 +414,23 @@ screen:redraw_debug() to show all intermediate screen states. ]]) end end - -- Extension features. The default expectations should cover the case of + -- UI extensions. The default expectations should cover the case of -- the ext_ feature being disabled, or the feature currently not activated - -- (for instance no external cmdline visible). Some extensions require + -- (e.g. no external cmdline visible). Some extensions require -- preprocessing to represent highlights in a reproducible way. local extstate = self:_extstate_repr(attr_state) - - -- convert assertion errors into invalid screen state descriptions - local status, res = pcall(function() - for _, k in ipairs(ext_keys) do - -- Empty states is considered the default and need not be mentioned - if not (expected[k] == nil and isempty(extstate[k])) then - eq(expected[k], extstate[k], k) + if expected['mode'] ~= nil then + extstate['mode'] = self.mode + end + -- Convert assertion errors into invalid screen state descriptions. + for _, k in ipairs(concat_tables(ext_keys, {'mode'})) do + -- Empty states are considered the default and need not be mentioned. + if (not (expected[k] == nil and isempty(extstate[k]))) then + local status, res = pcall(eq, expected[k], extstate[k], k) + if not status then + return (tostring(res)..'\nHint: full state of "'..k..'":\n '..inspect(extstate[k])) end end - if expected.mode ~= nil then - eq(expected.mode, self.mode, "mode") - end - end) - if not status then - return tostring(res) end end, expected) end |