From 1617c894cc7b8b36c1b9d215413741164cede930 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 11 Aug 2019 04:06:09 -0400 Subject: [PATCH] tests: Use rawget to avoid trigerring the tripwire. The next commit will introduce extra checks that would otherwise break this. --- tests/examples/awful/template.lua | 4 ++-- tests/examples/shims/screen.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/examples/awful/template.lua b/tests/examples/awful/template.lua index 75c4feec..aa79ff09 100644 --- a/tests/examples/awful/template.lua +++ b/tests/examples/awful/template.lua @@ -35,8 +35,8 @@ local function draw_mouse(x, y) end -- Print an outline for the screens -if not screen.no_outline then - for _, s in ipairs(screen) do +if not rawget(screen, "no_outline") then + for s in screen do cr:save() -- Draw the screen outline cr:set_source(color("#00000044")) diff --git a/tests/examples/shims/screen.lua b/tests/examples/shims/screen.lua index bf7f119c..171c06e1 100644 --- a/tests/examples/shims/screen.lua +++ b/tests/examples/shims/screen.lua @@ -78,7 +78,7 @@ end function screen._get_extents() local xmax, ymax - for _, v in ipairs(screen) do + for v in screen do if not xmax or v.geometry.x+v.geometry.width > xmax.geometry.x+xmax.geometry.width then xmax = v end