]> git.sur5r.net Git - i3/i3/blob - testcases/t/145-flattening.t
Merge branch 'displayversion'
[i3/i3] / testcases / t / 145-flattening.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # by moving the window in the opposite orientation that its parent has, we
5 # force i3 to create a new split container with the appropriate orientation.
6 # However, when doing that two times in a row, we end up with two split
7 # containers which are then redundant (workspace is horizontal, then v-split,
8 # then h-split – we could just append the children of the latest h-split to the
9 # workspace itself).
10 #
11 # This testcase checks that the tree is properly flattened after moving.
12 #
13 use X11::XCB qw(:all);
14 use i3test;
15
16 my $x = X11::XCB::Connection->new;
17
18 my $tmp = fresh_workspace;
19
20 my $left = open_window($x);
21 my $mid = open_window($x);
22 my $right = open_window($x);
23
24 cmd 'move before v';
25 cmd 'move after h';
26 my $ws = get_ws($tmp);
27
28 is($ws->{orientation}, 'horizontal', 'workspace orientation is horizontal');
29 is(@{$ws->{nodes}}, 3, 'all three windows on workspace level');
30
31 done_testing;