]> git.sur5r.net Git - i3/i3/blob - testcases/t/145-flattening.t
Merge branch 'next'
[i3/i3] / testcases / t / 145-flattening.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
6 #   (or docs/testsuite)
7 #
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
10 #
11 # • http://build.i3wm.org/docs/ipc.html
12 #   (or docs/ipc)
13 #
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 #   (unless you are already familiar with Perl)
16 #
17 # by moving the window in the opposite orientation that its parent has, we
18 # force i3 to create a new split container with the appropriate orientation.
19 # However, when doing that two times in a row, we end up with two split
20 # containers which are then redundant (workspace is horizontal, then v-split,
21 # then h-split – we could just append the children of the latest h-split to the
22 # workspace itself).
23 #
24 # This testcase checks that the tree is properly flattened after moving.
25 #
26 use i3test;
27
28 my $tmp = fresh_workspace;
29
30 my $left = open_window;
31 my $mid = open_window;
32 my $right = open_window;
33
34 cmd 'move up';
35 cmd 'move right';
36 my $ws = get_ws($tmp);
37
38 is($ws->{layout}, 'splith', 'workspace layout is splith');
39 is(@{$ws->{nodes}}, 3, 'all three windows on workspace level');
40
41 done_testing;