2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • http://build.i3wm.org/docs/ipc.html
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 # (unless you are already familiar with Perl)
17 # Tests whether 'workspace next' works correctly.
19 use List::Util qw(first);
20 use i3test i3_autostart => 0;
26 # We need to sync after changing focus to a different output to wait for the
27 # EnterNotify to be processed, otherwise it will be processed at some point
28 # later in time and mess up our subsequent tests.
31 is(focused_ws, $expected, "workspace $expected focused");
37 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
39 fake-outputs 1024x768+0+0,1024x768+1024+0
41 my $pid = launch_with_config($config);
43 ################################################################################
44 # Setup workspaces so that they stay open (with an empty container).
45 # Have only named workspaces in the 1st output and numbered + named workspaces
47 ################################################################################
50 $x->root->warp_pointer(0, 0);
54 # ensure workspace A stays open
58 # ensure workspace B stays open
62 # ensure workspace D stays open
66 # ensure workspace E stays open
69 cmd 'focus output right';
72 # ensure workspace 1 stays open
76 # ensure workspace 2 stays open
80 # ensure workspace 3 stays open
84 # ensure workspace 4 stays open
88 # ensure workspace 5 stays open
92 # ensure workspace C stays open
96 # ensure workspace F stays open
99 cmd 'focus output right';
101 ################################################################################
102 # Use workspace next and verify the correct order.
103 ################################################################################
105 # The current order should be:
106 # output 1: A, B, D, E
107 # output 2: 1, 2, 3, 4, 5, C, F
110 is(focused_ws, 'A', 'back on workspace A');
125 exit_gracefully($pid);