From 7712383475c354eeb654b7d5c0fb3f77789bd81f Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 28 Oct 2016 16:58:30 +0200 Subject: [PATCH] Add a test for screen :swap() Signed-off-by: Uli Schlachter --- tests/test-screen-changes.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test-screen-changes.lua b/tests/test-screen-changes.lua index 0e1a83ce9..68d624ad6 100644 --- a/tests/test-screen-changes.lua +++ b/tests/test-screen-changes.lua @@ -9,6 +9,11 @@ local real_screen = screen[1] local fake_screen = screen.fake_add(50, 50, 500, 500) local test_client1, test_client2 +local list_count = 0 +screen.connect_signal("list", function() + list_count = list_count + 1 +end) + local steps = { -- Step 1: Set up some clients to experiment with and assign them as needed function(count) @@ -53,6 +58,15 @@ local steps = { assert(wb.y == 110, wb.y) assert(wb.width == 600, wb.width) + -- Test screen order changes + assert(list_count == 0) + assert(screen[1] == real_screen) + assert(screen[2] == fake_screen) + real_screen:swap(fake_screen) + assert(list_count == 1) + assert(screen[2] == real_screen) + assert(screen[1] == fake_screen) + return true end,