testcases: Implement open_empty_con which directly returns the ID

This commit is contained in:
Michael Stapelberg 2010-07-17 15:17:16 +02:00
parent d066341261
commit 55f695436a
1 changed files with 8 additions and 1 deletions

View File

@ -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