From b3635a0101d36a2fd2ae9b47cdd813861b797af5 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 8 Apr 2017 10:00:34 +0200 Subject: [PATCH] Make the output of the gears.object.signal example stable (#1703) Previously it would print a table which would include the memory location where the table was stored. Thus, this produces a different result on every build. Signed-off-by: Uli Schlachter --- tests/examples/text/gears/object/signal.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/examples/text/gears/object/signal.lua b/tests/examples/text/gears/object/signal.lua index e21bdb315..109d35fdd 100644 --- a/tests/examples/text/gears/object/signal.lua +++ b/tests/examples/text/gears/object/signal.lua @@ -2,6 +2,11 @@ local gears = require("gears") --DOC_HIDE local o = gears.object{} +-- Add a __tostring metamethod for prettier output --DOC_HIDE +getmetatable(o).__tostring = function() --DOC_HIDE + return "[obj]" --DOC_HIDE +end --DOC_HIDE + -- Function can be attached to signals local function slot(obj, a, b, c) print("In slot", obj, a, b, c)