implement con_id for matching containers, extend testcase
This commit is contained in:
@ -3,7 +3,8 @@
|
||||
#
|
||||
# Tests whether opening an empty container and killing it again works
|
||||
#
|
||||
use Test::More tests => 3;
|
||||
use Test::More tests => 6;
|
||||
use Data::Dumper;
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin/lib";
|
||||
use i3test;
|
||||
@ -25,4 +26,25 @@ ok(@{get_ws_content($tmp)} == 1, 'container opened');
|
||||
$i3->command("kill")->recv;
|
||||
ok(@{get_ws_content($tmp)} == 0, 'container killed');
|
||||
|
||||
##############################################################
|
||||
# open two containers and kill the one which is not focused
|
||||
# by its ID to test if the parser correctly matches the window
|
||||
##############################################################
|
||||
|
||||
$i3->command('open')->recv;
|
||||
$i3->command('open')->recv;
|
||||
ok(@{get_ws_content($tmp)} == 2, 'two containers opened');
|
||||
|
||||
my $content = get_ws_content($tmp);
|
||||
# TODO: get the focused window, don’t assume that it is
|
||||
# the latest one
|
||||
my $id = $content->[0]->{id};
|
||||
diag('id of not focused = ' . $id);
|
||||
|
||||
$i3->command("[con_id=\"$id\"] kill")->recv;
|
||||
|
||||
$content = get_ws_content($tmp);
|
||||
ok(@{$content} == 1, 'one container killed');
|
||||
ok($content->[0]->{id} != $id, 'correct window killed');
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
|
Reference in New Issue
Block a user