aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-07-20 14:19:57 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-07-20 14:25:07 +0200
commitd19d9e4d9eaffa7cd23dd71329531c88f59274c7 (patch)
tree7fed771061ef1c1c3f8cae029105807b1159f16a
parent6b45e12d67ec01c8a7c5896529df88b9105d5c2b (diff)
downloadrneovim-d19d9e4d9eaffa7cd23dd71329531c88f59274c7.tar.gz
rneovim-d19d9e4d9eaffa7cd23dd71329531c88f59274c7.tar.bz2
rneovim-d19d9e4d9eaffa7cd23dd71329531c88f59274c7.zip
screen.lua: always print keyword-args snapshot
-rw-r--r--test/functional/ui/screen.lua14
1 files changed, 5 insertions, 9 deletions
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index 742c0d5ceb..c067cca048 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -1251,12 +1251,9 @@ function Screen:get_snapshot(attrs, ignore)
local lines = self:render(true, attr_state, true)
local ext_state = self:_extstate_repr(attr_state)
- local keys = false
for k, v in pairs(ext_state) do
if isempty(v) then
ext_state[k] = nil -- deleting keys while iterating is ok
- else
- keys = true
end
end
@@ -1275,11 +1272,11 @@ function Screen:get_snapshot(attrs, ignore)
end
end
- return kwargs, ext_state, attr_state, keys
+ return kwargs, ext_state, attr_state
end
function Screen:print_snapshot(attrs, ignore)
- local kwargs, ext_state, attr_state, keys = self:get_snapshot(attrs, ignore)
+ local kwargs, ext_state, attr_state = self:get_snapshot(attrs, ignore)
local attrstr = ""
if attr_state.modified then
local attrstrs = {}
@@ -1293,10 +1290,9 @@ function Screen:print_snapshot(attrs, ignore)
local keyval = (type(i) == "number") and "["..tostring(i).."]" or i
table.insert(attrstrs, " "..keyval.." = "..dict..",")
end
- attrstr = (", "..(keys and "attr_ids=" or "")
- .."{\n"..table.concat(attrstrs, "\n").."\n}")
+ attrstr = (", attr_ids={\n"..table.concat(attrstrs, "\n").."\n}")
end
- print( "\nscreen:expect"..(keys and "{grid=" or "(").."[[")
+ print( "\nscreen:expect{grid=[[")
print(kwargs.grid)
io.stdout:write( "]]"..attrstr)
for _, k in ipairs(ext_keys) do
@@ -1305,7 +1301,7 @@ function Screen:print_snapshot(attrs, ignore)
io.stdout:write(", "..k.."="..inspect(ext_state[k],{process=remove_all_metatables}))
end
end
- print((keys and "}" or ")").."\n")
+ print("}\n")
io.stdout:flush()
end