From dc6241456a817f926fd50fcee67c41ca68e6ed58 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 28 Jan 2011 01:21:38 +0100 Subject: [PATCH] testcases: use the does_i3_live function --- testcases/t/26-regress-close.t | 17 ++++++----------- testcases/t/27-regress-floating-parent.t | 4 +--- testcases/t/34-invalid-command.t | 8 ++------ testcases/t/42-regress-move-floating.t | 4 +--- testcases/t/47-regress-floatingmove.t | 4 +--- 5 files changed, 11 insertions(+), 26 deletions(-) diff --git a/testcases/t/26-regress-close.t b/testcases/t/26-regress-close.t index 125caf73..349ffca5 100644 --- a/testcases/t/26-regress-close.t +++ b/testcases/t/26-regress-close.t @@ -7,19 +7,14 @@ use i3test tests => 1; use X11::XCB qw(:all); -my $i3 = i3("/tmp/nestedcons"); - my $tmp = get_unused_workspace(); -$i3->command("workspace $tmp")->recv; - -$i3->command('open')->recv; -$i3->command('mode toggle')->recv; -$i3->command('kill')->recv; -$i3->command('kill')->recv; +cmd "workspace $tmp"; +cmd 'open'; +cmd 'mode toggle'; +cmd 'kill'; +cmd 'kill'; -my $tree = $i3->get_tree->recv; -my @nodes = @{$tree->{nodes}}; -ok(@nodes > 0, 'i3 still lives'); +does_i3_live; diag( "Testing i3, Perl $], $^X" ); diff --git a/testcases/t/27-regress-floating-parent.t b/testcases/t/27-regress-floating-parent.t index 0074af6f..d72fd350 100644 --- a/testcases/t/27-regress-floating-parent.t +++ b/testcases/t/27-regress-floating-parent.t @@ -40,8 +40,6 @@ is(get_focused($tmp), $floating, 'floating window focused'); sleep 1; $i3->command('mode toggle')->recv; -my $tree = $i3->get_tree->recv; -my @nodes = @{$tree->{nodes}}; -ok(@nodes > 0, 'i3 still lives'); +does_i3_live; diag( "Testing i3, Perl $], $^X" ); diff --git a/testcases/t/34-invalid-command.t b/testcases/t/34-invalid-command.t index e1cc2c6f..cfb330a1 100644 --- a/testcases/t/34-invalid-command.t +++ b/testcases/t/34-invalid-command.t @@ -5,12 +5,8 @@ # use i3test tests => 1; -my $i3 = i3("/tmp/nestedcons"); +cmd 'blargh!'; -$i3->command("blargh!")->recv; - -my $tree = $i3->get_tree->recv; -my @nodes = @{$tree->{nodes}}; -ok(@nodes > 0, 'i3 still lives'); +does_i3_live; diag( "Testing i3, Perl $], $^X" ); diff --git a/testcases/t/42-regress-move-floating.t b/testcases/t/42-regress-move-floating.t index 2fc14177..1c4fae13 100644 --- a/testcases/t/42-regress-move-floating.t +++ b/testcases/t/42-regress-move-floating.t @@ -14,6 +14,4 @@ cmd 'open'; cmd 'mode toggle'; cmd "move workspace $otmp"; -my $tree = i3('/tmp/nestedcons')->get_tree->recv; -my @nodes = @{$tree->{nodes}}; -ok(@nodes > 0, 'i3 still lives'); +does_i3_live; diff --git a/testcases/t/47-regress-floatingmove.t b/testcases/t/47-regress-floatingmove.t index ae6fe963..189d2808 100644 --- a/testcases/t/47-regress-floatingmove.t +++ b/testcases/t/47-regress-floatingmove.t @@ -34,6 +34,4 @@ sleep 0.25; cmd 'move before v'; sleep 0.25; -my $tree = i3('/tmp/nestedcons')->get_tree->recv; -my @nodes = @{$tree->{nodes}}; -ok(@nodes > 0, 'i3 still lives'); +does_i3_live; -- 2.39.5