]> git.sur5r.net Git - i3/i3/blobdiff - testcases/lib/i3test.pm
Merge branch 'master' into next
[i3/i3] / testcases / lib / i3test.pm
index f7be1b665d8a9f3eb8697e1d27a7bbf155ce97a2..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
@@ -288,7 +289,7 @@ sub fresh_workspace {
     if (exists($args{output})) {
         my $i3 = i3(get_socket_path());
         my $tree = $i3->get_tree->recv;
-        my $output = first { $_->{name} eq "xinerama-$args{output}" }
+        my $output = first { $_->{name} eq "fake-$args{output}" }
                         @{$tree->{nodes}};
         die "BUG: Could not find output $args{output}" unless defined($output);
         # Get the focused workspace on that output and switch to it.
@@ -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';