]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/05-ipc.t
Merge branch 'tree' into next
[i3/i3] / testcases / t / 05-ipc.t
index 62a3a9d44879679fe6f7cab6e508dbc414928623..a910c930b19a87e377e1ffa2c57b05ff4de43231 100644 (file)
@@ -1,9 +1,8 @@
 #!perl
 # vim:ts=4:sw=4:expandtab
 
-use i3test tests => 2;
+use i3test;
 use X11::XCB qw(:all);
-use Time::HiRes qw(sleep);
 
 BEGIN {
     use_ok('X11::XCB::Connection') or BAIL_OUT('Cannot load X11::XCB::Connection');
@@ -11,28 +10,25 @@ BEGIN {
 
 my $x = X11::XCB::Connection->new;
 
-my $i3 = i3("/tmp/nestedcons");
-my $tmp = get_unused_workspace();
-$i3->command("workspace $tmp")->recv;
+fresh_workspace;
 
 #####################################################################
 # Ensure IPC works by switching workspaces
 #####################################################################
 
 # Create a window so we can get a focus different from NULL
-my $window = i3test::open_standard_window($x);
+my $window = open_standard_window($x);
 diag("window->id = " . $window->id);
 
-sleep(0.25);
+sleep 0.25;
 
 my $focus = $x->input_focus;
 diag("old focus = $focus");
 
-# Switch to the nineth workspace
-my $otmp = get_unused_workspace();
-$i3->command("workspace $otmp")->recv;
+# Switch to another workspace
+fresh_workspace;
 
 my $new_focus = $x->input_focus;
 isnt($focus, $new_focus, "Focus changed");
 
-diag( "Testing i3, Perl $], $^X" );
+done_testing;