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)
19 # Create a floating window which is smaller than the minimum enforced size of i3
20 my $window = open_floating_window;
22 isa_ok($window, 'X11::XCB::Window');
24 my ($absolute, $top) = $window->rect;
26 ok($window->mapped, 'Window is mapped');
27 cmp_ok($absolute->{width}, '>=', 75, 'i3 raised the width to 75');
28 cmp_ok($absolute->{height}, '>=', 50, 'i3 raised the height to 50');
30 ok($absolute->{x} != 0 && $absolute->{y} != 0, 'i3 did not map it to (0x0)');
34 $window = open_floating_window(rect => [ 20, 20, 80, 90 ]);
36 isa_ok($window, 'X11::XCB::Window');
38 ($absolute, $top) = $window->rect;
40 cmp_ok($absolute->{width}, '==', 80, "i3 let the width at 80");
41 cmp_ok($absolute->{height}, '==', 90, "i3 let the height at 90");
43 cmp_ok($top->{x}, '==', 20, 'i3 mapped it to x=20');
44 cmp_ok($top->{y}, '==', 20, 'i3 mapped it to y=20');
48 #####################################################################
49 # check that a tiling window which is then made floating still has
50 # at least the size of its initial geometry
51 #####################################################################
53 $window = open_window(rect => [ 1, 1, 80, 90 ]);
55 isa_ok($window, 'X11::XCB::Window');
57 cmd 'floating enable';
60 ($absolute, $top) = $window->rect;
62 cmp_ok($absolute->{width}, '==', 80, "i3 let the width at 80");
63 cmp_ok($absolute->{height}, '==', 90, "i3 let the height at 90");