Skip to content

Commit

Permalink
Improve verbose output of test/compare.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
craigbarnes committed Jan 8, 2018
1 parent 6735c60 commit 935c457
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/compare.lua
Expand Up @@ -59,8 +59,7 @@ local function compare(t1, t2)
seen[index] = true
end
elseif verbose then
local index = keys:tostring(k)
stderr:write(("OK: %s\n"):format(index))
stderr:write(" OK: ", keys:tostring(k), "\n")
end
end
return true
Expand All @@ -74,5 +73,9 @@ local t1 = assert(ltcn.parse(text, filename))
local fn = assert(load("return" .. text, "=" .. filename, "t"))
local t2 = assert(fn())

if verbose then
stderr:write("\n", filename, "\n", ("-"):rep(#filename), "\n")
end

compare(t1, t2)
compare(t2, t1)

0 comments on commit 935c457

Please sign in to comment.