aboutsummaryrefslogtreecommitdiff
path: root/testcases/t/191-resize-levels.t
blob: 9e483230b25329f6ab701c2b3f6a3cea0226028a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!perl
# vim:ts=4:sw=4:expandtab
#
# Please read the following documents before working on tests:
# • https://build.i3wm.org/docs/testsuite.html
#   (or docs/testsuite)
#
# • https://build.i3wm.org/docs/lib-i3test.html
#   (alternatively: perldoc ./testcases/lib/i3test.pm)
#
# • https://build.i3wm.org/docs/ipc.html
#   (or docs/ipc)
#
# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
#   (unless you are already familiar with Perl)
#
# Verifies that you can resize across different levels of containers even when
# they are all of the same orientation.
# (Ticket #754)
use i3test;

my $tmp = fresh_workspace;

open_window;
open_window;
cmd 'split v';
my $middle = open_window;
open_window;
cmd 'focus parent';
cmd 'split h';
open_window;

cmd '[id="' . $middle->id . '"] focus';
is($x->input_focus, $middle->id, 'middle window focused');

cmd 'resize grow left 10px or 25ppt';

my ($nodes, $focus) = get_ws_content($tmp);

cmp_float($nodes->[0]->{percent}, 0.25, 'left container got only 25%');
cmp_float($nodes->[1]->{percent}, 0.75, 'right container got 75%');

done_testing;