From 32ea923721f840954567708b4bc8128dfdc984dc Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 2 Oct 2011 22:18:21 +0100 Subject: [PATCH] add a test for the 'move workspace next/prev' command --- testcases/t/32-move-workspace.t | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/testcases/t/32-move-workspace.t b/testcases/t/32-move-workspace.t index 3b50e39b..82e59dd1 100644 --- a/testcases/t/32-move-workspace.t +++ b/testcases/t/32-move-workspace.t @@ -37,6 +37,39 @@ is($focus->[0], $second, 'same container on different ws'); ($nodes, $focus) = get_ws_content($tmp); ok($nodes->[0]->{focused}, 'first container focused on first ws'); +################################################################### +# check if 'move workspace next' and 'move workspace prev' work +################################################################### + +# Open two containers on the first workspace, one container on the second +# workspace. Because the workspaces are named, they will be sorted by order of +# creation. +$tmp = get_unused_workspace(); +$tmp2 = get_unused_workspace(); +cmd "workspace $tmp"; +ok(@{get_ws_content($tmp)} == 0, 'no containers yet'); +$first = open_empty_con($i3); +$second = open_empty_con($i3); +ok(@{get_ws_content($tmp)} == 2, 'two containers on first ws'); + +cmd "workspace $tmp2"; +ok(@{get_ws_content($tmp2)} == 0, 'no containers yet'); +my $third = open_empty_con($i3); +ok(@{get_ws_content($tmp2)} == 1, 'one container on second ws'); + +# go back to the first workspace, move one of the containers to the next one +cmd "workspace $tmp"; +cmd 'move workspace next'; +ok(@{get_ws_content($tmp)} == 1, 'one container on first ws'); +ok(@{get_ws_content($tmp2)} == 2, 'two containers on second ws'); + +# go to the second workspace and move two containers to the first one +cmd "workspace $tmp2"; +cmd 'move workspace prev'; +cmd 'move workspace prev'; +ok(@{get_ws_content($tmp)} == 3, 'three containers on first ws'); +ok(@{get_ws_content($tmp2)} == 0, 'no containers on second ws'); + ################################################################### # check if floating cons are moved to new workspaces properly # (that is, if they are floating on the target ws, too) -- 2.39.5