X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=testcases%2Ft%2F112-floating-resize.t;h=947ca3b6086ff286d4d7e2df49660653463fe8ea;hb=37d0105c8328f718740c2ae9bae0dff87287a467;hp=ff3a1c04e0922cf3b3cd759b278f27894e2f8651;hpb=f2b73b64beee5831a5def220a951fe8e90fca195;p=i3%2Fi3 diff --git a/testcases/t/112-floating-resize.t b/testcases/t/112-floating-resize.t index ff3a1c04..947ca3b6 100644 --- a/testcases/t/112-floating-resize.t +++ b/testcases/t/112-floating-resize.t @@ -1,5 +1,18 @@ #!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) use i3test; @@ -55,4 +68,22 @@ cmd 'border 1pixel'; test_resize; +################################################################################ +# Check if we can position a floating window out of bounds. The Xephyr screen +# is 1280x1024, so x=2864, y=893 is out of bounds. +################################################################################ + +($a, $t) = $window->rect; +$window->rect(X11::XCB::Rect->new( + x => 2864, + y => 893, + width => $a->width, + height => $a->height)); + +sync_with_i3; + +($a, $t) = $window->rect; +cmp_ok($a->x, '<', 1280, 'X not moved out of bounds'); +cmp_ok($a->y, '<', 1024, 'Y not moved out of bounds'); + done_testing;