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 # Verifies that switching between the different layouts works as expected.
20 my $tmp = fresh_workspace;
27 my ($nodes, $focus) = get_ws_content($tmp);
28 is($nodes->[1]->{layout}, 'splitv', 'layout is splitv currently');
31 ($nodes, $focus) = get_ws_content($tmp);
32 is($nodes->[1]->{layout}, 'stacked', 'layout now stacked');
35 ($nodes, $focus) = get_ws_content($tmp);
36 is($nodes->[1]->{layout}, 'tabbed', 'layout now tabbed');
38 cmd 'layout toggle split';
39 ($nodes, $focus) = get_ws_content($tmp);
40 is($nodes->[1]->{layout}, 'splitv', 'layout now splitv again');
42 cmd 'layout toggle split';
43 ($nodes, $focus) = get_ws_content($tmp);
44 is($nodes->[1]->{layout}, 'splith', 'layout now splith');
46 cmd 'layout toggle split';
47 ($nodes, $focus) = get_ws_content($tmp);
48 is($nodes->[1]->{layout}, 'splitv', 'layout now splitv');
50 cmd 'layout toggle split';
51 ($nodes, $focus) = get_ws_content($tmp);
52 is($nodes->[1]->{layout}, 'splith', 'layout now splith');
55 ($nodes, $focus) = get_ws_content($tmp);
56 is($nodes->[1]->{layout}, 'stacked', 'layout now stacked');
59 ($nodes, $focus) = get_ws_content($tmp);
60 is($nodes->[1]->{layout}, 'tabbed', 'layout now tabbed');
63 ($nodes, $focus) = get_ws_content($tmp);
64 is($nodes->[1]->{layout}, 'splith', 'layout now splith');
67 ($nodes, $focus) = get_ws_content($tmp);
68 is($nodes->[1]->{layout}, 'stacked', 'layout now stacked');
70 cmd 'layout toggle all';
71 ($nodes, $focus) = get_ws_content($tmp);
72 is($nodes->[1]->{layout}, 'tabbed', 'layout now tabbed');
74 cmd 'layout toggle all';
75 ($nodes, $focus) = get_ws_content($tmp);
76 is($nodes->[1]->{layout}, 'splith', 'layout now splith');
78 cmd 'layout toggle all';
79 ($nodes, $focus) = get_ws_content($tmp);
80 is($nodes->[1]->{layout}, 'splitv', 'layout now splitv');
82 cmd 'layout toggle all';
83 ($nodes, $focus) = get_ws_content($tmp);
84 is($nodes->[1]->{layout}, 'stacked', 'layout now stacked');
86 cmd 'layout toggle all';
87 ($nodes, $focus) = get_ws_content($tmp);
88 is($nodes->[1]->{layout}, 'tabbed', 'layout now tabbed');
90 cmd 'layout toggle all';
91 ($nodes, $focus) = get_ws_content($tmp);
92 is($nodes->[1]->{layout}, 'splith', 'layout now splith');
94 cmd 'layout toggle all';
95 ($nodes, $focus) = get_ws_content($tmp);
96 is($nodes->[1]->{layout}, 'splitv', 'layout now splitv');