]> git.sur5r.net Git - i3/i3/blobdiff - testcases/lib/i3test.pm
Merge branch 'master' into next
[i3/i3] / testcases / lib / i3test.pm
index 4c41a7f2f27d4ccbc210f913417262dcabdd7992..32a17934d8e23d6e91cfb9645dcee68faeecf432 100644 (file)
@@ -33,6 +33,7 @@ our @EXPORT = qw(
     open_floating_window
     get_dock_clients
     cmd
+    cmp_float
     sync_with_i3
     does_i3_live
     exit_gracefully
@@ -563,6 +564,14 @@ sub launch_with_config {
     return $i3_pid;
 }
 
+# compares two floats and return true if they differ less
+# then 1e-6
+sub cmp_float {
+  my ($a, $b) = @_;
+
+  return abs($a - $b) < 1e-6;
+}
+
 package i3test::X11;
 use parent 'X11::XCB::Connection';