tests: clean up/beautify all tests (code style / test style)
This commit is contained in:
@ -4,21 +4,18 @@
|
||||
# Tests whether opening an empty container and killing it again works
|
||||
#
|
||||
use List::Util qw(first);
|
||||
use i3test tests => 6;
|
||||
use i3test;
|
||||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
|
||||
my $tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
|
||||
|
||||
# Open a new container
|
||||
$i3->command("open")->recv;
|
||||
cmd 'open';
|
||||
|
||||
ok(@{get_ws_content($tmp)} == 1, 'container opened');
|
||||
|
||||
$i3->command("kill")->recv;
|
||||
cmd 'kill';
|
||||
ok(@{get_ws_content($tmp)} == 0, 'container killed');
|
||||
|
||||
##############################################################
|
||||
@ -26,18 +23,18 @@ ok(@{get_ws_content($tmp)} == 0, 'container killed');
|
||||
# by its ID to test if the parser correctly matches the window
|
||||
##############################################################
|
||||
|
||||
$i3->command('open')->recv;
|
||||
$i3->command('open')->recv;
|
||||
cmd 'open';
|
||||
cmd 'open';
|
||||
ok(@{get_ws_content($tmp)} == 2, 'two containers opened');
|
||||
|
||||
my $content = get_ws_content($tmp);
|
||||
my $not_focused = first { !$_->{focused} } @{$content};
|
||||
my $id = $not_focused->{id};
|
||||
|
||||
$i3->command("[con_id=\"$id\"] kill")->recv;
|
||||
cmd "[con_id=\"$id\"] kill";
|
||||
|
||||
$content = get_ws_content($tmp);
|
||||
ok(@{$content} == 1, 'one container killed');
|
||||
ok($content->[0]->{id} != $id, 'correct window killed');
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
Reference in New Issue
Block a user