From 55f695436a860af785aa28a57455f43cf11253a2 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 17 Jul 2010 15:17:16 +0200 Subject: [PATCH] testcases: Implement open_empty_con which directly returns the ID --- testcases/t/lib/i3test.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/testcases/t/lib/i3test.pm b/testcases/t/lib/i3test.pm index cf4baccc..2fcfc064 100644 --- a/testcases/t/lib/i3test.pm +++ b/testcases/t/lib/i3test.pm @@ -10,7 +10,7 @@ use List::Util qw(first); use v5.10; use Exporter (); -our @EXPORT = qw(get_workspace_names get_unused_workspace get_ws_content get_ws get_focused); +our @EXPORT = qw(get_workspace_names get_unused_workspace get_ws_content get_ws get_focused open_empty_con); BEGIN { my $window_count = 0; @@ -53,6 +53,13 @@ sub open_standard_window { return $window; } +sub open_empty_con { + my ($i3) = @_; + + my $reply = $i3->command('open')->recv; + return $reply->{id}; +} + sub get_workspace_names { my $i3 = i3("/tmp/nestedcons"); # TODO: use correct command as soon as AnyEvent::i3 is updated