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)
21 #####################################################################
22 # Create a floating window and see if resizing works
23 #####################################################################
25 my $window = open_floating_window;
27 # See if configurerequests cause window movements (they should not)
28 my ($a, $t) = $window->rect;
29 $window->rect(X11::XCB::Rect->new(x => $a->x, y => $a->y, width => $a->width, height => $a->height));
33 my ($na, $nt) = $window->rect;
34 is_deeply($na, $a, 'Rects are equal after configurerequest');
37 $window->rect(X11::XCB::Rect->new(x => 0, y => 0, width => 100, height => 100));
41 my ($absolute, $top) = $window->rect;
43 # Make sure the width/height are different from what we’re gonna test, so
44 # that the test will work.
45 isnt($absolute->width, 300, 'width != 300');
46 isnt($absolute->height, 500, 'height != 500');
48 $window->rect(X11::XCB::Rect->new(x => 0, y => 0, width => 300, height => 500));
52 ($absolute, $top) = $window->rect;
54 is($absolute->width, 300, 'width = 300');
55 is($absolute->height, 500, 'height = 500');
58 # Test with default border
66 # Test with 1-px-border
71 ################################################################################
72 # Check if we can position a floating window out of bounds. The Xephyr screen
73 # is 1280x1024, so x=2864, y=893 is out of bounds.
74 ################################################################################
76 ($a, $t) = $window->rect;
77 $window->rect(X11::XCB::Rect->new(
81 height => $a->height));
85 ($a, $t) = $window->rect;
86 cmp_ok($a->x, '<', 1280, 'X not moved out of bounds');
87 cmp_ok($a->y, '<', 1024, 'Y not moved out of bounds');