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 # Test for the --no-auto-back-and-forth flag.
21 my ($first, $second, $third);
26 ###############################################################################
27 # Switching to another workspace when passing --no-auto-back-and-forth works
28 # as if the flag wasn't set.
29 ###############################################################################
31 cmd qq|workspace "$first"|;
32 ok(get_ws($first)->{focused}, 'first workspace is focused');
34 cmd qq|workspace --no-auto-back-and-forth "$second"|;
35 ok(get_ws($second)->{focused}, 'second workspace is focused');
37 cmd qq|workspace --no-auto-back-and-forth number "$third"|;
38 ok(get_ws($third)->{focused}, 'third workspace is focused');
40 ###############################################################################
41 # Switching to the focused workspace when passing --no-auto-back-and-forth
43 ###############################################################################
45 cmd qq|workspace "$second"|;
46 cmd qq|workspace "$first"|;
47 ok(get_ws($first)->{focused}, 'first workspace is focused');
49 cmd qq|workspace --no-auto-back-and-forth "$first"|;
50 ok(get_ws($first)->{focused}, 'first workspace is still focused');
52 cmd qq|workspace --no-auto-back-and-forth number "$first"|;
53 ok(get_ws($first)->{focused}, 'first workspace is still focused');
55 ###############################################################################