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");
38 # We need to sync after changing focus to a different output to wait for the
39 # EnterNotify to be processed, otherwise it will be processed at some point
40 # later in time and mess up our subsequent tests.
43 is(focused_ws, $expected, "workspace $expected focused");
48 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
50 fake-outputs 1024x768+0+0,1024x768+1024+0
52 my $pid = launch_with_config($config);
55 $x->root->warp_pointer(0, 0);
58 ################################################################################
59 # Setup workspaces so that they stay open (with an empty container).
60 # open_window ensures, this
63 # output 1 (left) : 1, 2, 3, 6, 7, B, F, C
64 # output 2 (right): 4, 5, A, D, E
66 ################################################################################
68 cmd 'focus output right';
69 cmd 'workspace A'; open_window;
70 cmd 'workspace D'; open_window;
71 cmd 'workspace 4'; open_window;
72 cmd 'workspace 5'; open_window;
73 cmd 'workspace E'; open_window;
75 cmd 'focus output left';
76 cmd 'workspace 1'; open_window;
77 cmd 'workspace 2'; open_window;
78 cmd 'workspace B'; open_window;
79 cmd 'workspace 3'; open_window;
80 cmd 'workspace F'; open_window;
81 cmd 'workspace 6'; open_window;
82 cmd 'workspace C'; open_window;
83 cmd 'workspace 7'; open_window;
85 ################################################################################
86 # Use workspace next and verify the correct order.
87 # numbered -> numerical sort
88 # named -> sort by creation time
89 ################################################################################
91 is(focused_ws, '1', 'back on workspace 1');
109 is(focused_ws, '1', 'back on workspace 1');
127 exit_gracefully($pid);