]> git.sur5r.net Git - i3/i3/blob - testcases/t/252-floating-size.t
8d8d412036105fd17a18ebb9aaf72bae8e176733
[i3/i3] / testcases / t / 252-floating-size.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Please read the following documents before working on tests:
5 # • https://build.i3wm.org/docs/testsuite.html
6 #   (or docs/testsuite)
7 #
8 # • https://build.i3wm.org/docs/lib-i3test.html
9 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
10 #
11 # • https://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 # Test behavior of "resize <width> <height>" command.
18 # Ticket: #1727
19 # Bug still in: 4.10.2-1-gc0dbc5d
20 use i3test;
21
22 ################################################################################
23 # Check that setting floating windows size works
24 ################################################################################
25
26 my $tmp = fresh_workspace;
27
28 open_floating_window;
29
30 my @content = @{get_ws($tmp)->{floating_nodes}};
31 is(@content, 1, 'one floating node on this ws');
32
33 my $oldrect = $content[0]->{rect};
34
35 cmd 'resize set 100 px 250 px';
36
37 @content = @{get_ws($tmp)->{floating_nodes}};
38 cmp_ok($content[0]->{rect}->{x}, '==', $oldrect->{x}, 'x untouched');
39 cmp_ok($content[0]->{rect}->{y}, '==', $oldrect->{y}, 'y untouched');
40 cmp_ok($content[0]->{rect}->{width}, '!=', $oldrect->{width}, 'width changed');
41 cmp_ok($content[0]->{rect}->{height}, '!=', $oldrect->{width}, 'height changed');
42 cmp_ok($content[0]->{rect}->{width}, '==', 100, 'width changed to 100 px');
43 cmp_ok($content[0]->{rect}->{height}, '==', 250, 'height changed to 250 px');
44
45 done_testing;