2 # vim:ts=4:sw=4:expandtab
4 # Tests whether 'workspace next_on_output' and the like work correctly.
6 use List::Util qw(first);
9 ################################################################################
10 # Setup workspaces so that they stay open (with an empty container).
11 ################################################################################
13 is(focused_ws, '1', 'starting on workspace 1');
14 # ensure workspace 1 stays open
17 cmd 'focus output right';
18 is(focused_ws, '2', 'workspace 2 on second output');
19 # ensure workspace 2 stays open
22 cmd 'focus output right';
23 is(focused_ws, '1', 'back on workspace 1');
25 # We don’t use fresh_workspace with named workspaces here since they come last
26 # when using 'workspace next'.
28 # ensure workspace 5 stays open
31 ################################################################################
32 # Use workspace next and verify the correct order.
33 ################################################################################
35 # The current order should be:
40 is(focused_ws, '2', 'workspace 2 focused');
42 is(focused_ws, '5', 'workspace 5 focused');
44 ################################################################################
45 # Now try the same with workspace next_on_output.
46 ################################################################################
49 cmd 'workspace next_on_output';
50 is(focused_ws, '5', 'workspace 5 focused');
51 cmd 'workspace next_on_output';
52 is(focused_ws, '1', 'workspace 1 focused');
54 cmd 'workspace prev_on_output';
55 is(focused_ws, '5', 'workspace 5 focused');
56 cmd 'workspace prev_on_output';
57 is(focused_ws, '1', 'workspace 1 focused');
61 cmd 'workspace prev_on_output';
62 is(focused_ws, '2', 'workspace 2 focused');