]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/112-floating-resize.t
Merge pull request #2953 from CyberShadow/focus_wrapping
[i3/i3] / testcases / t / 112-floating-resize.t
index ff3a1c04e0922cf3b3cd759b278f27894e2f8651..947ca3b6086ff286d4d7e2df49660653463fe8ea 100644 (file)
@@ -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;