tests: clean up/beautify all tests (code style / test style)
This commit is contained in:
parent
57e7cc8f6a
commit
2524b5262d
|
@ -1,11 +1,11 @@
|
|||
#!perl
|
||||
# vim:ts=4:sw=4:expandtab
|
||||
|
||||
use i3test tests => 4;
|
||||
use i3test;
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
|
||||
BEGIN {
|
||||
use_ok('X11::XCB::Window');
|
||||
use_ok('X11::XCB::Window');
|
||||
}
|
||||
|
||||
my $x = X11::XCB::Connection->new;
|
||||
|
@ -13,9 +13,9 @@ my $x = X11::XCB::Connection->new;
|
|||
my $original_rect = X11::XCB::Rect->new(x => 0, y => 0, width => 30, height => 30);
|
||||
|
||||
my $window = $x->root->create_child(
|
||||
class => WINDOW_CLASS_INPUT_OUTPUT,
|
||||
rect => $original_rect,
|
||||
background_color => '#C0C0C0',
|
||||
class => WINDOW_CLASS_INPUT_OUTPUT,
|
||||
rect => $original_rect,
|
||||
background_color => '#C0C0C0',
|
||||
);
|
||||
|
||||
isa_ok($window, 'X11::XCB::Window');
|
||||
|
@ -29,4 +29,4 @@ sleep(0.25);
|
|||
my $new_rect = $window->rect;
|
||||
ok(!eq_deeply($new_rect, $original_rect), "Window got repositioned");
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
#!perl
|
||||
# vim:ts=4:sw=4:expandtab
|
||||
|
||||
use i3test tests => 24;
|
||||
use i3test;
|
||||
use X11::XCB qw(:all);
|
||||
use List::Util qw(first);
|
||||
use Time::HiRes qw(sleep);
|
||||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
|
||||
my $tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
sub fullscreen_windows {
|
||||
scalar grep { $_->{fullscreen_mode} != 0 } @{get_ws_content($tmp)}
|
||||
|
@ -52,20 +50,20 @@ is_deeply($window->rect, $original_rect, "rect unmodified before mapping");
|
|||
|
||||
$window->map;
|
||||
|
||||
sleep(0.25);
|
||||
sleep 0.25;
|
||||
|
||||
# open another container to make the window get only half of the screen
|
||||
$i3->command('open')->recv;
|
||||
cmd 'open';
|
||||
|
||||
my $new_rect = $window->rect;
|
||||
ok(!eq_deeply($new_rect, $original_rect), "Window got repositioned");
|
||||
$original_rect = $new_rect;
|
||||
|
||||
sleep(0.25);
|
||||
sleep 0.25;
|
||||
|
||||
$window->fullscreen(1);
|
||||
|
||||
sleep(0.25);
|
||||
sleep 0.25;
|
||||
|
||||
$new_rect = $window->rect;
|
||||
ok(!eq_deeply($new_rect, $original_rect), "Window got repositioned after fullscreen");
|
||||
|
@ -89,7 +87,7 @@ $window->unmap;
|
|||
|
||||
# open another container because the empty one will swallow the window we
|
||||
# map in a second
|
||||
$i3->command('open')->recv;
|
||||
cmd 'open';
|
||||
|
||||
$original_rect = X11::XCB::Rect->new(x => 0, y => 0, width => 30, height => 30);
|
||||
$window = $x->root->create_child(
|
||||
|
@ -129,7 +127,7 @@ my $swindow = $x->root->create_child(
|
|||
);
|
||||
|
||||
$swindow->map;
|
||||
sleep(0.25);
|
||||
sleep 0.25;
|
||||
|
||||
ok(!$swindow->mapped, 'window not mapped while fullscreen window active');
|
||||
|
||||
|
@ -158,16 +156,15 @@ sleep 0.25;
|
|||
|
||||
is(fullscreen_windows(), 0, 'amount of fullscreen windows after disabling');
|
||||
|
||||
$i3->command('fullscreen')->recv;
|
||||
cmd 'fullscreen';
|
||||
|
||||
is(fullscreen_windows(), 1, 'amount of fullscreen windows after fullscreen command');
|
||||
|
||||
$i3->command('fullscreen')->recv;
|
||||
cmd 'fullscreen';
|
||||
|
||||
is(fullscreen_windows(), 0, 'amount of fullscreen windows after fullscreen command');
|
||||
|
||||
# clean up the workspace so that it will be cleaned when switching away
|
||||
$i3->command('kill')->recv for (@{get_ws_content($tmp)});
|
||||
cmd 'kill' for (@{get_ws_content($tmp)});
|
||||
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!perl
|
||||
# vim:ts=4:sw=4:expandtab
|
||||
|
||||
use i3test tests => 5;
|
||||
use i3test;
|
||||
use X11::XCB qw(:all);
|
||||
|
||||
BEGIN {
|
||||
|
@ -30,4 +30,4 @@ isa_ok($new_rect, 'X11::XCB::Rect');
|
|||
|
||||
is_deeply($new_rect, $original_rect, "window untouched");
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#!perl
|
||||
# vim:ts=4:sw=4:expandtab
|
||||
|
||||
use i3test tests => 11;
|
||||
use i3test;
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
|
||||
BEGIN {
|
||||
use_ok('X11::XCB::Window');
|
||||
|
@ -24,7 +23,7 @@ isa_ok($window, 'X11::XCB::Window');
|
|||
|
||||
$window->map;
|
||||
|
||||
sleep(0.25);
|
||||
sleep 0.25;
|
||||
|
||||
my ($absolute, $top) = $window->rect;
|
||||
|
||||
|
@ -47,7 +46,7 @@ isa_ok($window, 'X11::XCB::Window');
|
|||
|
||||
$window->map;
|
||||
|
||||
sleep(0.25);
|
||||
sleep 0.25;
|
||||
|
||||
($absolute, $top) = $window->rect;
|
||||
|
||||
|
@ -61,4 +60,4 @@ cmp_ok($top->{y}, '==', 19, 'i3 mapped it to y=18');
|
|||
|
||||
$window->unmap;
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#!perl
|
||||
# vim:ts=4:sw=4:expandtab
|
||||
|
||||
use i3test tests => 2;
|
||||
use i3test;
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
|
||||
BEGIN {
|
||||
use_ok('X11::XCB::Connection') or BAIL_OUT('Cannot load X11::XCB::Connection');
|
||||
|
@ -11,28 +10,25 @@ BEGIN {
|
|||
|
||||
my $x = X11::XCB::Connection->new;
|
||||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
my $tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
fresh_workspace;
|
||||
|
||||
#####################################################################
|
||||
# Ensure IPC works by switching workspaces
|
||||
#####################################################################
|
||||
|
||||
# Create a window so we can get a focus different from NULL
|
||||
my $window = i3test::open_standard_window($x);
|
||||
my $window = open_standard_window($x);
|
||||
diag("window->id = " . $window->id);
|
||||
|
||||
sleep(0.25);
|
||||
sleep 0.25;
|
||||
|
||||
my $focus = $x->input_focus;
|
||||
diag("old focus = $focus");
|
||||
|
||||
# Switch to the nineth workspace
|
||||
my $otmp = get_unused_workspace();
|
||||
$i3->command("workspace $otmp")->recv;
|
||||
# Switch to another workspace
|
||||
fresh_workspace;
|
||||
|
||||
my $new_focus = $x->input_focus;
|
||||
isnt($focus, $new_focus, "Focus changed");
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#!perl
|
||||
# vim:ts=4:sw=4:expandtab
|
||||
|
||||
use i3test tests => 6;
|
||||
use i3test;
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
|
||||
BEGIN {
|
||||
use_ok('X11::XCB::Connection') or BAIL_OUT('Cannot load X11::XCB::Connection');
|
||||
|
@ -12,21 +11,20 @@ BEGIN {
|
|||
my $x = X11::XCB::Connection->new;
|
||||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
my $tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
#####################################################################
|
||||
# Create two windows and make sure focus switching works
|
||||
#####################################################################
|
||||
|
||||
# Change mode of the container to "default" for following tests
|
||||
$i3->command('layout default')->recv;
|
||||
$i3->command('split v')->recv;
|
||||
cmd 'layout default';
|
||||
cmd 'split v';
|
||||
|
||||
my $top = i3test::open_standard_window($x);
|
||||
my $mid = i3test::open_standard_window($x);
|
||||
my $bottom = i3test::open_standard_window($x);
|
||||
sleep(0.25);
|
||||
my $top = open_standard_window($x);
|
||||
my $mid = open_standard_window($x);
|
||||
my $bottom = open_standard_window($x);
|
||||
sleep 0.25;
|
||||
|
||||
diag("top id = " . $top->id);
|
||||
diag("mid id = " . $mid->id);
|
||||
|
@ -106,4 +104,4 @@ is($focus, $top->id, "Top window focused (wrapping to the bottom works)");
|
|||
#is($focus, $right->id, "right window focused");
|
||||
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -3,9 +3,8 @@
|
|||
# Checks if the focus is correctly restored, when creating a floating client
|
||||
# over an unfocused tiling client and destroying the floating one again.
|
||||
|
||||
use i3test tests => 4;
|
||||
use i3test;
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
|
||||
BEGIN {
|
||||
use_ok('X11::XCB::Window') or BAIL_OUT('Could not load X11::XCB::Window');
|
||||
|
@ -14,13 +13,11 @@ BEGIN {
|
|||
my $x = X11::XCB::Connection->new;
|
||||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
my $tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
fresh_workspace;
|
||||
|
||||
|
||||
$i3->command('split h')->recv;
|
||||
my $tiled_left = i3test::open_standard_window($x);
|
||||
my $tiled_right = i3test::open_standard_window($x);
|
||||
cmd 'split h';
|
||||
my $tiled_left = open_standard_window($x);
|
||||
my $tiled_right = open_standard_window($x);
|
||||
|
||||
sleep 0.25;
|
||||
|
||||
|
@ -49,4 +46,4 @@ sleep 0.25;
|
|||
|
||||
is($x->input_focus, $focus, 'Focus correctly restored');
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
use i3test;
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
use List::Util qw(first);
|
||||
|
||||
BEGIN {
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
use i3test tests => 6;
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
use Digest::SHA1 qw(sha1_base64);
|
||||
|
||||
BEGIN {
|
||||
|
@ -13,20 +12,19 @@ BEGIN {
|
|||
my $x = X11::XCB::Connection->new;
|
||||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
my $tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
fresh_workspace;
|
||||
|
||||
$i3->command('split h')->recv;
|
||||
cmd 'split h';
|
||||
|
||||
#####################################################################
|
||||
# Create two windows and make sure focus switching works
|
||||
#####################################################################
|
||||
|
||||
my $top = i3test::open_standard_window($x);
|
||||
my $top = open_standard_window($x);
|
||||
sleep 0.25;
|
||||
my $mid = i3test::open_standard_window($x);
|
||||
my $mid = open_standard_window($x);
|
||||
sleep 0.25;
|
||||
my $bottom = i3test::open_standard_window($x);
|
||||
my $bottom = open_standard_window($x);
|
||||
sleep 0.25;
|
||||
|
||||
diag("top id = " . $top->id);
|
||||
|
@ -40,7 +38,7 @@ diag("bottom id = " . $bottom->id);
|
|||
sub focus_after {
|
||||
my $msg = shift;
|
||||
|
||||
$i3->command($msg)->recv;
|
||||
cmd $msg;
|
||||
return $x->input_focus;
|
||||
}
|
||||
|
||||
|
@ -67,3 +65,4 @@ is($focus, $top->id, "Top window focused");
|
|||
$focus = focus_after(qq|[con_mark="$random_mark"] focus|);
|
||||
is($focus, $mid->id, "goto worked");
|
||||
|
||||
done_testing;
|
||||
|
|
|
@ -4,9 +4,8 @@
|
|||
# the workspace to be empty).
|
||||
# TODO: skip it by default?
|
||||
|
||||
use i3test tests => 15;
|
||||
use i3test;
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
|
||||
BEGIN {
|
||||
use_ok('X11::XCB::Connection') or BAIL_OUT('Cannot load X11::XCB::Connection');
|
||||
|
@ -14,9 +13,7 @@ BEGIN {
|
|||
|
||||
my $x = X11::XCB::Connection->new;
|
||||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
my $tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
fresh_workspace;
|
||||
|
||||
#####################################################################
|
||||
# Create a floating window and see if resizing works
|
||||
|
@ -67,11 +64,13 @@ sub test_resize {
|
|||
test_resize;
|
||||
|
||||
# Test borderless
|
||||
$i3->command('border none')->recv;
|
||||
cmd 'border none';
|
||||
|
||||
test_resize;
|
||||
|
||||
# Test with 1-px-border
|
||||
$i3->command('border 1pixel')->recv;
|
||||
cmd 'border 1pixel';
|
||||
|
||||
test_resize;
|
||||
|
||||
done_testing;
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#!perl
|
||||
# vim:ts=4:sw=4:expandtab
|
||||
|
||||
use i3test tests => 10;
|
||||
use i3test;
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
use List::Util qw(first);
|
||||
|
||||
BEGIN {
|
||||
|
@ -12,23 +11,21 @@ BEGIN {
|
|||
|
||||
my $x = X11::XCB::Connection->new;
|
||||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
my $tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
#####################################################################
|
||||
# Create two windows and put them in stacking mode
|
||||
#####################################################################
|
||||
|
||||
$i3->command('split v')->recv;
|
||||
cmd 'split v';
|
||||
|
||||
my $top = i3test::open_standard_window($x);
|
||||
my $bottom = i3test::open_standard_window($x);
|
||||
my $top = open_standard_window($x);
|
||||
my $bottom = open_standard_window($x);
|
||||
|
||||
my @urgent = grep { $_->{urgent} == 1 } @{get_ws_content($tmp)};
|
||||
is(@urgent, 0, 'no window got the urgent flag');
|
||||
|
||||
#$i3->command('layout stacking')->recv;
|
||||
# cmd 'layout stacking';
|
||||
|
||||
#####################################################################
|
||||
# Add the urgency hint, switch to a different workspace and back again
|
||||
|
@ -45,7 +42,7 @@ is($top_info->{urgent}, 1, 'top window is marked urgent');
|
|||
is($bottom_info->{urgent}, 0, 'bottom window is not marked urgent');
|
||||
is(@urgent, 1, 'exactly one window got the urgent flag');
|
||||
|
||||
$i3->command('[id="' . $top->id . '"] focus')->recv;
|
||||
cmd '[id="' . $top->id . '"] focus';
|
||||
|
||||
@urgent = grep { $_->{urgent} == 1 } @{get_ws_content($tmp)};
|
||||
is(@urgent, 0, 'no window got the urgent flag after focusing');
|
||||
|
@ -62,8 +59,7 @@ is(@urgent, 0, 'no window got the urgent flag after re-setting urgency hint');
|
|||
my $ws = get_ws($tmp);
|
||||
is($ws->{urgent}, 0, 'urgent flag not set on workspace');
|
||||
|
||||
my $otmp = get_unused_workspace();
|
||||
$i3->command("workspace $otmp")->recv;
|
||||
my $otmp = fresh_workspace;
|
||||
|
||||
$top->add_hint('urgency');
|
||||
sleep 0.5;
|
||||
|
@ -71,9 +67,9 @@ sleep 0.5;
|
|||
$ws = get_ws($tmp);
|
||||
is($ws->{urgent}, 1, 'urgent flag set on workspace');
|
||||
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
cmd "workspace $tmp";
|
||||
|
||||
$ws = get_ws($tmp);
|
||||
is($ws->{urgent}, 0, 'urgent flag not set on workspace after switching');
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#!perl
|
||||
# vim:ts=4:sw=4:expandtab
|
||||
|
||||
use i3test tests => 7;
|
||||
use i3test;
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
|
||||
BEGIN {
|
||||
use_ok('X11::XCB::Connection') or BAIL_OUT('Cannot load X11::XCB::Connection');
|
||||
|
@ -12,8 +11,7 @@ BEGIN {
|
|||
my $x = X11::XCB::Connection->new;
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
|
||||
my $tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
####################################################################################
|
||||
# first part: test if a floating window will be correctly positioned above its leader
|
||||
|
@ -114,11 +112,10 @@ $window->map;
|
|||
sleep 0.25;
|
||||
|
||||
#########################################################################
|
||||
# Switch workspace to 10 and open a child window. It should be positioned
|
||||
# on workspace 9.
|
||||
# Switch to a different workspace and open a child window. It should be opened
|
||||
# on the old workspace.
|
||||
#########################################################################
|
||||
my $otmp = get_unused_workspace();
|
||||
$i3->command("workspace $otmp")->recv;
|
||||
fresh_workspace;
|
||||
|
||||
my $child = $x->root->create_child(
|
||||
class => WINDOW_CLASS_INPUT_OUTPUT,
|
||||
|
@ -135,8 +132,10 @@ sleep 0.25;
|
|||
isnt($x->input_focus, $child->id, "Child window focused");
|
||||
|
||||
# Switch back
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
cmd "workspace $tmp";
|
||||
|
||||
is($x->input_focus, $child->id, "Child window focused");
|
||||
|
||||
}
|
||||
|
||||
done_testing;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!perl
|
||||
# vim:ts=4:sw=4:expandtab
|
||||
|
||||
use i3test tests => 2;
|
||||
use i3test;
|
||||
use List::MoreUtils qw(all);
|
||||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
|
@ -22,4 +22,4 @@ ok($name_exists, "All workspaces have a name");
|
|||
|
||||
}
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!perl
|
||||
# vim:ts=4:sw=4:expandtab
|
||||
|
||||
use i3test tests => 7;
|
||||
use i3test;
|
||||
use List::MoreUtils qw(all none);
|
||||
use List::Util qw(first);
|
||||
|
||||
|
@ -65,4 +65,4 @@ $i3->command('open')->recv;
|
|||
#diag(Dumper($tree));
|
||||
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -4,19 +4,14 @@
|
|||
# Tests whether we can switch to a non-existant workspace
|
||||
# (necessary for further tests)
|
||||
#
|
||||
use i3test tests => 3;
|
||||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
use i3test;
|
||||
|
||||
sub workspace_exists {
|
||||
my ($name) = @_;
|
||||
($name ~~ @{get_workspace_names()})
|
||||
}
|
||||
|
||||
my $tmp = get_unused_workspace();
|
||||
diag("Temporary workspace name: $tmp\n");
|
||||
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
my $tmp = fresh_workspace;
|
||||
ok(workspace_exists($tmp), 'workspace created');
|
||||
# if the workspace could not be created, we cannot run any other test
|
||||
# (every test starts by creating its workspace)
|
||||
|
@ -24,17 +19,17 @@ if (!workspace_exists($tmp)) {
|
|||
BAIL_OUT('Cannot create workspace, further tests make no sense');
|
||||
}
|
||||
|
||||
my $otmp = get_unused_workspace();
|
||||
my $otmp = fresh_workspace;
|
||||
diag("Other temporary workspace name: $otmp\n");
|
||||
|
||||
# As the old workspace was empty, it should get
|
||||
# cleaned up as we switch away from it
|
||||
$i3->command("workspace $otmp")->recv;
|
||||
cmd "workspace $otmp";
|
||||
ok(!workspace_exists($tmp), 'old workspace cleaned up');
|
||||
|
||||
# Switch to the same workspace again to make sure it doesn’t get cleaned up
|
||||
$i3->command("workspace $otmp")->recv;
|
||||
$i3->command("workspace $otmp")->recv;
|
||||
cmd "workspace $otmp";
|
||||
cmd "workspace $otmp";
|
||||
ok(workspace_exists($otmp), 'other workspace still exists');
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -3,13 +3,10 @@
|
|||
#
|
||||
# Tests all kinds of matching methods
|
||||
#
|
||||
use i3test tests => 4;
|
||||
use i3test;
|
||||
use X11::XCB qw(:all);
|
||||
|
||||
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');
|
||||
|
||||
|
@ -39,8 +36,8 @@ my $win = $content->[0];
|
|||
######################################################################
|
||||
# TODO: use PCRE expressions
|
||||
# TODO: specify more match types
|
||||
$i3->command(q|[class="*"] kill|)->recv;
|
||||
$i3->command(q|[con_id="99999"] kill|)->recv;
|
||||
cmd q|[class="*"] kill|;
|
||||
cmd q|[con_id="99999"] kill|;
|
||||
|
||||
$content = get_ws_content($tmp);
|
||||
ok(@{$content} == 1, 'window still there');
|
||||
|
@ -48,7 +45,7 @@ ok(@{$content} == 1, 'window still there');
|
|||
# now kill the window
|
||||
cmd 'nop now killing the window';
|
||||
my $id = $win->{id};
|
||||
$i3->command(qq|[con_id="$id"] kill|)->recv;
|
||||
cmd qq|[con_id="$id"] kill|;
|
||||
|
||||
# give i3 some time to pick up the UnmapNotify event
|
||||
sleep 0.25;
|
||||
|
@ -59,4 +56,4 @@ ok(@{$content} == 0, 'window killed');
|
|||
|
||||
# TODO: same test, but with pcre expressions
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -3,22 +3,18 @@
|
|||
#
|
||||
# Tests multiple commands (using ';') and multiple operations (using ',')
|
||||
#
|
||||
use i3test tests => 24;
|
||||
use X11::XCB qw(:all);
|
||||
use i3test;
|
||||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
|
||||
my $tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
sub multiple_cmds {
|
||||
my ($cmd) = @_;
|
||||
|
||||
$i3->command('open')->recv;
|
||||
$i3->command('open')->recv;
|
||||
cmd 'open';
|
||||
cmd 'open';
|
||||
ok(@{get_ws_content($tmp)} == 2, 'two containers opened');
|
||||
|
||||
$i3->command($cmd)->recv;
|
||||
cmd $cmd;
|
||||
ok(@{get_ws_content($tmp)} == 0, "both containers killed (cmd = $cmd)");
|
||||
}
|
||||
multiple_cmds('kill;kill');
|
||||
|
@ -36,4 +32,4 @@ multiple_cmds("kill \t ; \t kill");
|
|||
|
||||
# TODO: need a non-invasive command before implementing a test which uses ','
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -3,27 +3,23 @@
|
|||
#
|
||||
# Tests focus switching (next/prev)
|
||||
#
|
||||
use i3test tests => 14;
|
||||
use X11::XCB qw(:all);
|
||||
use i3test;
|
||||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
|
||||
my $tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
######################################################################
|
||||
# Open one container, verify that 'next v' and 'next h' do nothing
|
||||
######################################################################
|
||||
$i3->command('open')->recv;
|
||||
cmd 'open';
|
||||
|
||||
my ($nodes, $focus) = get_ws_content($tmp);
|
||||
my $old_focused = $focus->[0];
|
||||
|
||||
$i3->command('next v')->recv;
|
||||
cmd 'next v';
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
is($focus->[0], $old_focused, 'focus did not change with only one con');
|
||||
|
||||
$i3->command('next h')->recv;
|
||||
cmd 'next h';
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
is($focus->[0], $old_focused, 'focus did not change with only one con');
|
||||
|
||||
|
@ -32,38 +28,38 @@ is($focus->[0], $old_focused, 'focus did not change with only one con');
|
|||
######################################################################
|
||||
my $left = $old_focused;
|
||||
|
||||
$i3->command('open')->recv;
|
||||
cmd 'open';
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
isnt($old_focused, $focus->[0], 'new container is focused');
|
||||
my $mid = $focus->[0];
|
||||
|
||||
$i3->command('open')->recv;
|
||||
cmd 'open';
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
isnt($old_focused, $focus->[0], 'new container is focused');
|
||||
my $right = $focus->[0];
|
||||
|
||||
$i3->command('next h')->recv;
|
||||
cmd 'next h';
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
isnt($focus->[0], $right, 'focus did change');
|
||||
is($focus->[0], $left, 'left container focused (wrapping)');
|
||||
|
||||
$i3->command('next h')->recv;
|
||||
cmd 'next h';
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
is($focus->[0], $mid, 'middle container focused');
|
||||
|
||||
$i3->command('next h')->recv;
|
||||
cmd 'next h';
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
is($focus->[0], $right, 'right container focused');
|
||||
|
||||
$i3->command('prev h')->recv;
|
||||
cmd 'prev h';
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
is($focus->[0], $mid, 'middle container focused');
|
||||
|
||||
$i3->command('prev h')->recv;
|
||||
cmd 'prev h';
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
is($focus->[0], $left, 'left container focused');
|
||||
|
||||
$i3->command('prev h')->recv;
|
||||
cmd 'prev h';
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
is($focus->[0], $right, 'right container focused');
|
||||
|
||||
|
@ -72,11 +68,11 @@ is($focus->[0], $right, 'right container focused');
|
|||
# Test synonyms (horizontal/vertical instead of h/v)
|
||||
######################################################################
|
||||
|
||||
$i3->command('prev horizontal')->recv;
|
||||
cmd 'prev horizontal';
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
is($focus->[0], $mid, 'middle container focused');
|
||||
|
||||
$i3->command('next horizontal')->recv;
|
||||
cmd 'next horizontal';
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
is($focus->[0], $right, 'right container focused');
|
||||
|
||||
|
@ -84,9 +80,9 @@ is($focus->[0], $right, 'right container focused');
|
|||
# Test focus command
|
||||
######################################################################
|
||||
|
||||
$i3->command(qq|[con_id="$mid"] focus|)->recv;
|
||||
cmd qq|[con_id="$mid"] focus|;
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
is($focus->[0], $mid, 'middle container focused');
|
||||
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -3,17 +3,14 @@
|
|||
#
|
||||
# Tests splitting
|
||||
#
|
||||
use i3test tests => 14;
|
||||
use i3test;
|
||||
use X11::XCB qw(:all);
|
||||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
|
||||
my $tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
my $ws = get_ws($tmp);
|
||||
is($ws->{orientation}, 'horizontal', 'orientation horizontal by default');
|
||||
$i3->command('split v')->recv;
|
||||
cmd 'split v';
|
||||
$ws = get_ws($tmp);
|
||||
is($ws->{orientation}, 'vertical', 'split v changes workspace orientation');
|
||||
|
||||
|
@ -21,8 +18,8 @@ is($ws->{orientation}, 'vertical', 'split v changes workspace orientation');
|
|||
# Open two containers, split, open another container. Then verify
|
||||
# the layout is like we expect it to be
|
||||
######################################################################
|
||||
$i3->command('open')->recv;
|
||||
$i3->command('open')->recv;
|
||||
cmd 'open';
|
||||
cmd 'open';
|
||||
my $content = get_ws_content($tmp);
|
||||
|
||||
is(@{$content}, 2, 'two containers on workspace level');
|
||||
|
@ -34,8 +31,8 @@ is(@{$second->{nodes}}, 0, 'second container has no children (yet)');
|
|||
my $old_name = $second->{name};
|
||||
|
||||
|
||||
$i3->command('split h')->recv;
|
||||
$i3->command('open')->recv;
|
||||
cmd 'split h';
|
||||
cmd 'open';
|
||||
|
||||
$content = get_ws_content($tmp);
|
||||
|
||||
|
@ -57,16 +54,15 @@ is($second->{nodes}->[0]->{name}, $old_name, 'found old second container');
|
|||
# Test splitting multiple times without actually creating windows
|
||||
######################################################################
|
||||
|
||||
$tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
$tmp = fresh_workspace;
|
||||
|
||||
$ws = get_ws($tmp);
|
||||
is($ws->{orientation}, 'horizontal', 'orientation horizontal by default');
|
||||
$i3->command('split v')->recv;
|
||||
cmd 'split v';
|
||||
$ws = get_ws($tmp);
|
||||
is($ws->{orientation}, 'vertical', 'split v changes workspace orientation');
|
||||
|
||||
$i3->command('open')->recv;
|
||||
cmd 'open';
|
||||
my @content = @{get_ws_content($tmp)};
|
||||
|
||||
# recursively sums up all nodes and their children
|
||||
|
@ -82,15 +78,15 @@ sub sum_nodes {
|
|||
}
|
||||
|
||||
my $old_count = sum_nodes(\@content);
|
||||
$i3->command('split v')->recv;
|
||||
cmd 'split v';
|
||||
|
||||
@content = @{get_ws_content($tmp)};
|
||||
$old_count = sum_nodes(\@content);
|
||||
|
||||
$i3->command('split v')->recv;
|
||||
cmd 'split v';
|
||||
|
||||
@content = @{get_ws_content($tmp)};
|
||||
my $count = sum_nodes(\@content);
|
||||
is($count, $old_count, 'not more windows after splitting again');
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -7,13 +7,11 @@
|
|||
# 3) move a container inside another container
|
||||
# 4) move a container in a different direction so that we need to go up in tree
|
||||
#
|
||||
use i3test tests => 16;
|
||||
use X11::XCB qw(:all);
|
||||
use i3test;
|
||||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
|
||||
my $tmp = get_unused_workspace();
|
||||
cmd "workspace $tmp";
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
######################################################################
|
||||
# 1) move a container which cannot be moved
|
||||
|
@ -26,10 +24,10 @@ is(@{$old_content}, 1, 'one container on this workspace');
|
|||
|
||||
my $first = $old_content->[0]->{id};
|
||||
|
||||
#$i3->command('move before h')->recv;
|
||||
#$i3->command('move before v')->recv;
|
||||
#$i3->command('move after v')->recv;
|
||||
#$i3->command('move after h')->recv;
|
||||
#cmd 'move before h';
|
||||
#cmd 'move before v';
|
||||
#cmd 'move after v';
|
||||
#cmd 'move after h';
|
||||
|
||||
my $content = get_ws_content($tmp);
|
||||
#is_deeply($old_content, $content, 'workspace unmodified after useless moves');
|
||||
|
@ -38,7 +36,7 @@ my $content = get_ws_content($tmp);
|
|||
# 2) move a container before another single container
|
||||
######################################################################
|
||||
|
||||
$i3->command('open')->recv;
|
||||
cmd 'open';
|
||||
$content = get_ws_content($tmp);
|
||||
is(@{$content}, 2, 'two containers on this workspace');
|
||||
my $second = $content->[1]->{id};
|
||||
|
@ -46,22 +44,22 @@ my $second = $content->[1]->{id};
|
|||
is($content->[0]->{id}, $first, 'first container unmodified');
|
||||
|
||||
# Move the second container before the first one (→ swap them)
|
||||
$i3->command('move left')->recv;
|
||||
cmd 'move left';
|
||||
$content = get_ws_content($tmp);
|
||||
is($content->[0]->{id}, $second, 'first container modified');
|
||||
|
||||
# We should not be able to move any further
|
||||
$i3->command('move left')->recv;
|
||||
cmd 'move left';
|
||||
$content = get_ws_content($tmp);
|
||||
is($content->[0]->{id}, $second, 'first container unmodified');
|
||||
|
||||
# Now move in the other direction
|
||||
$i3->command('move right')->recv;
|
||||
cmd 'move right';
|
||||
$content = get_ws_content($tmp);
|
||||
is($content->[0]->{id}, $first, 'first container modified');
|
||||
|
||||
# We should not be able to move any further
|
||||
$i3->command('move right')->recv;
|
||||
cmd 'move right';
|
||||
$content = get_ws_content($tmp);
|
||||
is($content->[0]->{id}, $first, 'first container unmodified');
|
||||
|
||||
|
@ -76,15 +74,15 @@ is($content->[0]->{id}, $first, 'first container unmodified');
|
|||
# | first | ------ | third |
|
||||
# | | | |
|
||||
# --------------------------
|
||||
$i3->command('split v')->recv;
|
||||
$i3->command('level up')->recv;
|
||||
$i3->command('open')->recv;
|
||||
cmd 'split v';
|
||||
cmd 'level up';
|
||||
cmd 'open';
|
||||
|
||||
$content = get_ws_content($tmp);
|
||||
is(@{$content}, 3, 'three containers on this workspace');
|
||||
my $third = $content->[2]->{id};
|
||||
|
||||
$i3->command('move left')->recv;
|
||||
cmd 'move left';
|
||||
$content = get_ws_content($tmp);
|
||||
is(@{$content}, 2, 'only two containers on this workspace');
|
||||
my $nodes = $content->[1]->{nodes};
|
||||
|
@ -95,19 +93,19 @@ is($nodes->[1]->{id}, $third, 'third container on bottom');
|
|||
# move it inside the split container
|
||||
######################################################################
|
||||
|
||||
$i3->command('move up')->recv;
|
||||
cmd 'move up';
|
||||
$nodes = get_ws_content($tmp)->[1]->{nodes};
|
||||
is($nodes->[0]->{id}, $third, 'third container on top');
|
||||
is($nodes->[1]->{id}, $second, 'second container on bottom');
|
||||
|
||||
# move it outside again
|
||||
$i3->command('move left')->recv;
|
||||
cmd 'move left';
|
||||
$content = get_ws_content($tmp);
|
||||
is(@{$content}, 3, 'three nodes on this workspace');
|
||||
|
||||
# due to automatic flattening/cleanup, the remaining split container
|
||||
# will be replaced by the con itself, so we will still have 3 nodes
|
||||
$i3->command('move right')->recv;
|
||||
cmd 'move right';
|
||||
$content = get_ws_content($tmp);
|
||||
is(@{$content}, 2, 'two nodes on this workspace');
|
||||
|
||||
|
@ -117,21 +115,20 @@ is(@{$content}, 2, 'two nodes on this workspace');
|
|||
# container needs to be closed. Verify that it will be closed.
|
||||
######################################################################
|
||||
|
||||
my $otmp = get_unused_workspace();
|
||||
cmd "workspace $otmp";
|
||||
my $otmp = fresh_workspace;
|
||||
|
||||
$i3->command("open")->recv;
|
||||
$i3->command("open")->recv;
|
||||
$i3->command("split v")->recv;
|
||||
$i3->command("open")->recv;
|
||||
$i3->command("prev h")->recv;
|
||||
$i3->command("split v")->recv;
|
||||
$i3->command("open")->recv;
|
||||
$i3->command("move right")->recv;
|
||||
$i3->command("prev h")->recv;
|
||||
$i3->command("move right")->recv;
|
||||
cmd "open";
|
||||
cmd "open";
|
||||
cmd "split v";
|
||||
cmd "open";
|
||||
cmd "prev h";
|
||||
cmd "split v";
|
||||
cmd "open";
|
||||
cmd "move right";
|
||||
cmd "prev h";
|
||||
cmd "move right";
|
||||
|
||||
$content = get_ws_content($otmp);
|
||||
is(@{$content}, 1, 'only one nodes on this workspace');
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -4,11 +4,9 @@
|
|||
# Regression: closing of floating clients did crash i3 when closing the
|
||||
# container which contained this client.
|
||||
#
|
||||
use i3test tests => 1;
|
||||
use X11::XCB qw(:all);
|
||||
use i3test;
|
||||
|
||||
my $tmp = get_unused_workspace();
|
||||
cmd "workspace $tmp";
|
||||
fresh_workspace;
|
||||
|
||||
cmd 'open';
|
||||
cmd 'mode toggle';
|
||||
|
@ -17,4 +15,4 @@ cmd 'kill';
|
|||
|
||||
does_i3_live;
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -3,43 +3,39 @@
|
|||
#
|
||||
# Regression: make a container floating, kill its parent, make it tiling again
|
||||
#
|
||||
use i3test tests => 4;
|
||||
use X11::XCB qw(:all);
|
||||
use i3test;
|
||||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
my $tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
|
||||
$i3->command('open')->recv;
|
||||
cmd 'open';
|
||||
my $left = get_focused($tmp);
|
||||
$i3->command('open')->recv;
|
||||
cmd 'open';
|
||||
my $old = get_focused($tmp);
|
||||
$i3->command('split v')->recv;
|
||||
$i3->command('open')->recv;
|
||||
cmd 'split v';
|
||||
cmd 'open';
|
||||
my $floating = get_focused($tmp);
|
||||
diag("focused floating: " . get_focused($tmp));
|
||||
$i3->command('mode toggle')->recv;
|
||||
cmd 'mode toggle';
|
||||
# TODO: eliminate this race conditition
|
||||
sleep 1;
|
||||
|
||||
# kill old container
|
||||
$i3->command(qq|[con_id="$old"] focus|)->recv;
|
||||
cmd qq|[con_id="$old"] focus|;
|
||||
is(get_focused($tmp), $old, 'old container focused');
|
||||
$i3->command('kill')->recv;
|
||||
cmd 'kill';
|
||||
|
||||
# kill left container
|
||||
$i3->command(qq|[con_id="$left"] focus|)->recv;
|
||||
cmd qq|[con_id="$left"] focus|;
|
||||
is(get_focused($tmp), $left, 'old container focused');
|
||||
$i3->command('kill')->recv;
|
||||
cmd 'kill';
|
||||
|
||||
# focus floating window, make it tiling again
|
||||
$i3->command(qq|[con_id="$floating"] focus|)->recv;
|
||||
cmd qq|[con_id="$floating"] focus|;
|
||||
is(get_focused($tmp), $floating, 'floating window focused');
|
||||
|
||||
sleep 1;
|
||||
$i3->command('mode toggle')->recv;
|
||||
cmd 'mode toggle';
|
||||
|
||||
does_i3_live;
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -4,12 +4,11 @@
|
|||
# Check if new containers are opened after the currently focused one instead
|
||||
# of always at the end
|
||||
use List::Util qw(first);
|
||||
use i3test tests => 7;
|
||||
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');
|
||||
|
||||
|
@ -26,8 +25,8 @@ isnt($first, $second, 'different container focused');
|
|||
# see if new containers open after the currently focused
|
||||
##############################################################
|
||||
|
||||
$i3->command(qq|[con_id="$first"] focus|)->recv;
|
||||
$i3->command('open')->recv;
|
||||
cmd qq|[con_id="$first"] focus|;
|
||||
cmd 'open';
|
||||
$content = get_ws_content($tmp);
|
||||
ok(@{$content} == 3, 'three containers opened');
|
||||
|
||||
|
@ -35,6 +34,4 @@ is($content->[0]->{id}, $first, 'first container unmodified');
|
|||
isnt($content->[1]->{id}, $second, 'second container replaced');
|
||||
is($content->[2]->{id}, $second, 'third container unmodified');
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
#
|
||||
|
||||
done_testing;
|
||||
|
|
|
@ -3,26 +3,24 @@
|
|||
#
|
||||
# Check if the focus is correctly restored after closing windows.
|
||||
#
|
||||
use i3test tests => 9;
|
||||
use i3test;
|
||||
use List::Util qw(first);
|
||||
use Time::HiRes qw(sleep);
|
||||
|
||||
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');
|
||||
|
||||
my $first = open_empty_con($i3);
|
||||
my $second = open_empty_con($i3);
|
||||
|
||||
$i3->command('split v')->recv;
|
||||
cmd 'split v';
|
||||
|
||||
my ($nodes, $focus) = get_ws_content($tmp);
|
||||
|
||||
is($nodes->[1]->{focused}, 0, 'split container not focused');
|
||||
$i3->command('level up')->recv;
|
||||
cmd 'level up';
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
is($nodes->[1]->{focused}, 1, 'split container focused after level up');
|
||||
|
||||
|
@ -43,7 +41,7 @@ isnt(get_focused($tmp), $second, 'different container focused');
|
|||
# when closing $second
|
||||
##############################################################
|
||||
|
||||
$i3->command('kill')->recv;
|
||||
cmd 'kill';
|
||||
# TODO: this testcase sometimes has different outcomes when the
|
||||
# sleep is missing. why?
|
||||
sleep 0.25;
|
||||
|
@ -55,20 +53,19 @@ is($nodes->[1]->{nodes}->[0]->{focused}, 1, 'second container focused');
|
|||
# another case, using a slightly different layout (regression)
|
||||
##############################################################
|
||||
|
||||
$tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
$tmp = fresh_workspace;
|
||||
|
||||
ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
|
||||
|
||||
$i3->command('split v')->recv;
|
||||
cmd 'split v';
|
||||
$first = open_empty_con($i3);
|
||||
my $bottom = open_empty_con($i3);
|
||||
|
||||
$i3->command('prev v')->recv;
|
||||
$i3->command('split h')->recv;
|
||||
cmd 'prev v';
|
||||
cmd 'split h';
|
||||
my $middle = open_empty_con($i3);
|
||||
my $right = open_empty_con($i3);
|
||||
$i3->command('next v')->recv;
|
||||
cmd 'next v';
|
||||
|
||||
# We have the following layout now (second is focused):
|
||||
# .----------------------------.
|
||||
|
@ -82,7 +79,7 @@ $i3->command('next v')->recv;
|
|||
# `----------------------------'
|
||||
|
||||
# Check if the focus is restored to $right when we close $second
|
||||
$i3->command('kill')->recv;
|
||||
cmd 'kill';
|
||||
|
||||
is(get_focused($tmp), $right, 'top right container focused (in focus stack)');
|
||||
|
||||
|
@ -98,4 +95,4 @@ is($tr->{focused}, 1, 'top right container really has focus');
|
|||
|
||||
# TODO: add test code as soon as I can reproduce it
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -3,31 +3,29 @@
|
|||
#
|
||||
# Check if empty split containers are automatically closed.
|
||||
#
|
||||
use i3test tests => 8;
|
||||
use Time::HiRes qw(sleep);
|
||||
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');
|
||||
|
||||
my $first = open_empty_con($i3);
|
||||
my $second = open_empty_con($i3);
|
||||
$i3->command(qq|[con_id="$first"] focus|)->recv;
|
||||
cmd qq|[con_id="$first"] focus|;
|
||||
|
||||
$i3->command('split v')->recv;
|
||||
cmd 'split v';
|
||||
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
|
||||
is($nodes->[0]->{focused}, 0, 'split container not focused');
|
||||
|
||||
# focus the split container
|
||||
$i3->command('level up')->recv;
|
||||
cmd 'level up';
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
my $split = $focus->[0];
|
||||
$i3->command('level down')->recv;
|
||||
cmd 'level down';
|
||||
|
||||
my $second = open_empty_con($i3);
|
||||
|
||||
|
@ -37,8 +35,8 @@ isnt($first, $second, 'different container focused');
|
|||
# close both windows and see if the split container still exists
|
||||
##############################################################
|
||||
|
||||
$i3->command('kill')->recv;
|
||||
$i3->command('kill')->recv;
|
||||
cmd 'kill';
|
||||
cmd 'kill';
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
isnt($nodes->[0]->{id}, $split, 'split container closed');
|
||||
|
||||
|
@ -47,26 +45,25 @@ isnt($nodes->[0]->{id}, $split, 'split container closed');
|
|||
# of killing them
|
||||
##############################################################
|
||||
|
||||
$tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
$tmp = fresh_workspace;
|
||||
|
||||
ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
|
||||
|
||||
$first = open_empty_con($i3);
|
||||
$second = open_empty_con($i3);
|
||||
$i3->command(qq|[con_id="$first"] focus|)->recv;
|
||||
cmd qq|[con_id="$first"] focus|;
|
||||
|
||||
$i3->command('split v')->recv;
|
||||
cmd 'split v';
|
||||
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
|
||||
is($nodes->[0]->{focused}, 0, 'split container not focused');
|
||||
|
||||
# focus the split container
|
||||
$i3->command('level up')->recv;
|
||||
cmd 'level up';
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
my $split = $focus->[0];
|
||||
$i3->command('level down')->recv;
|
||||
cmd 'level down';
|
||||
|
||||
my $second = open_empty_con($i3);
|
||||
|
||||
|
@ -77,9 +74,9 @@ isnt($first, $second, 'different container focused');
|
|||
##############################################################
|
||||
|
||||
my $otmp = get_unused_workspace();
|
||||
$i3->command("move workspace $otmp")->recv;
|
||||
$i3->command("move workspace $otmp")->recv;
|
||||
cmd "move workspace $otmp";
|
||||
cmd "move workspace $otmp";
|
||||
($nodes, $focus) = get_ws_content($tmp);
|
||||
isnt($nodes->[0]->{id}, $split, 'split container closed');
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -5,18 +5,16 @@
|
|||
# the split mode (horizontal/vertical) of the underlying
|
||||
# container.
|
||||
#
|
||||
use i3test tests => 7;
|
||||
use Time::HiRes qw(sleep);
|
||||
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');
|
||||
|
||||
# Enforce vertical split mode
|
||||
$i3->command('split v')->recv;
|
||||
cmd 'split v';
|
||||
|
||||
my $first = open_empty_con($i3);
|
||||
my $second = open_empty_con($i3);
|
||||
|
@ -27,28 +25,28 @@ isnt($first, $second, 'two different containers opened');
|
|||
# change mode to stacking and cycle through the containers
|
||||
##############################################################
|
||||
|
||||
$i3->command('layout stacking')->recv;
|
||||
cmd 'layout stacking';
|
||||
is(get_focused($tmp), $second, 'second container still focused');
|
||||
|
||||
$i3->command('next v')->recv;
|
||||
cmd 'next v';
|
||||
is(get_focused($tmp), $first, 'first container focused');
|
||||
|
||||
$i3->command('prev v')->recv;
|
||||
cmd 'prev v';
|
||||
is(get_focused($tmp), $second, 'second container focused again');
|
||||
|
||||
##############################################################
|
||||
# now change the orientation to horizontal and cycle
|
||||
##############################################################
|
||||
|
||||
$i3->command('level up')->recv;
|
||||
$i3->command('split h')->recv;
|
||||
$i3->command('level down')->recv;
|
||||
cmd 'level up';
|
||||
cmd 'split h';
|
||||
cmd 'level down';
|
||||
|
||||
$i3->command('next v')->recv;
|
||||
cmd 'next v';
|
||||
is(get_focused($tmp), $first, 'first container focused');
|
||||
|
||||
$i3->command('prev v')->recv;
|
||||
cmd 'prev v';
|
||||
is(get_focused($tmp), $second, 'second container focused again');
|
||||
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
#
|
||||
# Checks if the 'move workspace' command works correctly
|
||||
#
|
||||
use i3test tests => 11;
|
||||
use Time::HiRes qw(sleep);
|
||||
use i3test;
|
||||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
|
||||
|
@ -60,4 +59,4 @@ $ws = get_ws($tmp2);
|
|||
is(@{$ws->{nodes}}, 0, 'no nodes on workspace');
|
||||
is(@{$ws->{floating_nodes}}, 1, 'one floating node on workspace');
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -3,15 +3,13 @@
|
|||
#
|
||||
# Checks if size hints are interpreted correctly.
|
||||
#
|
||||
use i3test tests => 2;
|
||||
use Time::HiRes qw(sleep);
|
||||
use i3test;
|
||||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
|
||||
my $x = X11::XCB::Connection->new;
|
||||
|
||||
my $tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
|
||||
|
||||
|
@ -41,4 +39,4 @@ my $ar = $rect->width / $rect->height;
|
|||
diag("Aspect ratio = $ar");
|
||||
ok(($ar > 1.90) && ($ar < 2.10), 'Aspect ratio about 2.0');
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
#
|
||||
#
|
||||
#
|
||||
use i3test tests => 1;
|
||||
use i3test;
|
||||
|
||||
cmd 'blargh!';
|
||||
|
||||
does_i3_live;
|
||||
|
||||
diag( "Testing i3, Perl $], $^X" );
|
||||
done_testing;
|
||||
|
|
|
@ -1,27 +1,23 @@
|
|||
#!perl
|
||||
# vim:ts=4:sw=4:expandtab
|
||||
|
||||
use i3test tests => 9;
|
||||
use Time::HiRes qw(sleep);
|
||||
use i3test;
|
||||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
|
||||
my $tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
#############################################################################
|
||||
# 1: see if focus stays the same when toggling tiling/floating mode
|
||||
#############################################################################
|
||||
|
||||
$i3->command("open")->recv;
|
||||
$i3->command("open")->recv;
|
||||
cmd "open";
|
||||
cmd "open";
|
||||
|
||||
my @content = @{get_ws_content($tmp)};
|
||||
cmp_ok(@content, '==', 2, 'two containers opened');
|
||||
cmp_ok($content[1]->{focused}, '==', 1, 'Second container focused');
|
||||
|
||||
$i3->command("mode floating")->recv;
|
||||
$i3->command("mode tiling")->recv;
|
||||
cmd "mode floating";
|
||||
cmd "mode tiling";
|
||||
|
||||
@content = @{get_ws_content($tmp)};
|
||||
cmp_ok($content[1]->{focused}, '==', 1, 'Second container still focused after mode toggle');
|
||||
|
@ -31,12 +27,11 @@ cmp_ok($content[1]->{focused}, '==', 1, 'Second container still focused after mo
|
|||
# (first to the next floating client, then to the last focused tiling client)
|
||||
#############################################################################
|
||||
|
||||
$tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
$tmp = fresh_workspace;
|
||||
|
||||
$i3->command("open")->recv;
|
||||
$i3->command("open")->recv;
|
||||
$i3->command("open")->recv;
|
||||
cmd "open";
|
||||
cmd "open";
|
||||
cmd "open";
|
||||
|
||||
@content = @{get_ws_content($tmp)};
|
||||
cmp_ok(@content, '==', 3, 'two containers opened');
|
||||
|
@ -47,26 +42,28 @@ my $second_id = $content[1]->{id};
|
|||
my $first_id = $content[0]->{id};
|
||||
diag("last_id = $last_id, second_id = $second_id, first_id = $first_id");
|
||||
|
||||
$i3->command(qq|[con_id="$second_id"] focus|)->recv;
|
||||
cmd qq|[con_id="$second_id"] focus|;
|
||||
@content = @{get_ws_content($tmp)};
|
||||
cmp_ok($content[1]->{focused}, '==', 1, 'Second container focused');
|
||||
|
||||
$i3->command("mode floating")->recv;
|
||||
cmd "mode floating";
|
||||
|
||||
$i3->command(qq|[con_id="$last_id"] focus|)->recv;
|
||||
cmd qq|[con_id="$last_id"] focus|;
|
||||
@content = @{get_ws_content($tmp)};
|
||||
cmp_ok($content[1]->{focused}, '==', 1, 'Last container focused');
|
||||
|
||||
$i3->command("mode floating")->recv;
|
||||
cmd "mode floating";
|
||||
|
||||
diag("focused = " . get_focused($tmp));
|
||||
|
||||
$i3->command("kill")->recv;
|
||||
cmd "kill";
|
||||
|
||||
diag("focused = " . get_focused($tmp));
|
||||
# TODO: this test result is actually not right. the focus reverts to where the mouse pointer is.
|
||||
cmp_ok(get_focused($tmp), '==', $second_id, 'Focus reverted to second floating container');
|
||||
|
||||
$i3->command("kill")->recv;
|
||||
cmd "kill";
|
||||
@content = @{get_ws_content($tmp)};
|
||||
cmp_ok($content[0]->{focused}, '==', 1, 'Focus reverted to tiling container');
|
||||
|
||||
done_testing;
|
||||
|
|
|
@ -2,9 +2,8 @@
|
|||
# vim:ts=4:sw=4:expandtab
|
||||
# Regression test: when only having a floating window on a workspace, it should not be deleted.
|
||||
|
||||
use i3test tests => 6;
|
||||
use i3test;
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
|
||||
BEGIN {
|
||||
use_ok('X11::XCB::Window');
|
||||
|
@ -12,8 +11,7 @@ BEGIN {
|
|||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
|
||||
my $tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
#############################################################################
|
||||
# 1: open a floating window, get it mapped
|
||||
|
@ -47,8 +45,9 @@ ok($window->mapped, 'Window is mapped');
|
|||
|
||||
# switch to a different workspace, see if the window is still mapped?
|
||||
|
||||
my $otmp = get_unused_workspace();
|
||||
$i3->command("workspace $otmp")->recv;
|
||||
my $otmp = fresh_workspace;
|
||||
|
||||
ok(workspace_exists($otmp), "new workspace $otmp exists");
|
||||
ok(workspace_exists($tmp), "old workspace $tmp still exists");
|
||||
|
||||
done_testing;
|
||||
|
|
|
@ -3,9 +3,8 @@
|
|||
# Regression test: Floating windows were not correctly unmapped when switching
|
||||
# to a different workspace.
|
||||
|
||||
use i3test tests => 4;
|
||||
use i3test;
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
|
||||
BEGIN {
|
||||
use_ok('X11::XCB::Window');
|
||||
|
@ -13,8 +12,7 @@ BEGIN {
|
|||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
|
||||
my $tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
#############################################################################
|
||||
# 1: open a floating window, get it mapped
|
||||
|
@ -41,11 +39,12 @@ ok($window->mapped, 'Window is mapped');
|
|||
|
||||
# switch to a different workspace, see if the window is still mapped?
|
||||
|
||||
my $otmp = get_unused_workspace();
|
||||
$i3->command("workspace $otmp")->recv;
|
||||
my $otmp = fresh_workspace;
|
||||
|
||||
sleep 0.25;
|
||||
|
||||
ok(!$window->mapped, 'Window is not mapped after switching ws');
|
||||
|
||||
$i3->command("nop testcase done")->recv;
|
||||
cmd "nop testcase done";
|
||||
|
||||
done_testing;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Regression test: New windows were attached to the container of a floating window
|
||||
# if only a floating window is present on the workspace.
|
||||
|
||||
use i3test tests => 7;
|
||||
use i3test;
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
|
||||
|
@ -13,8 +13,7 @@ BEGIN {
|
|||
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
|
||||
my $tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
#############################################################################
|
||||
# 1: open a floating window, get it mapped
|
||||
|
@ -61,3 +60,5 @@ sleep 0.25;
|
|||
($nodes, $focus) = get_ws_content($tmp);
|
||||
|
||||
is(@{$nodes}, 1, 'one tiling node');
|
||||
|
||||
done_testing;
|
||||
|
|
|
@ -2,9 +2,8 @@
|
|||
# vim:ts=4:sw=4:expandtab
|
||||
# Check if numbered workspaces and named workspaces are sorted in the right way
|
||||
# in get_workspaces IPC output (necessary for i3bar etc.).
|
||||
use i3test tests => 9;
|
||||
use i3test;
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
|
||||
BEGIN {
|
||||
use_ok('X11::XCB::Window');
|
||||
|
@ -29,7 +28,7 @@ check_order('workspace order alright before testing');
|
|||
# open a window to keep this ws open
|
||||
#############################################################################
|
||||
|
||||
$i3->command("workspace 93")->recv;
|
||||
cmd "workspace 93";
|
||||
|
||||
open_standard_window($x);
|
||||
|
||||
|
@ -38,22 +37,24 @@ my @f = grep { defined($_->{num}) && $_->{num} == 93 } @ws;
|
|||
is(@f, 1, 'ws 93 found by num');
|
||||
check_order('workspace order alright after opening 93');
|
||||
|
||||
$i3->command("workspace 92")->recv;
|
||||
cmd "workspace 92";
|
||||
open_standard_window($x);
|
||||
check_order('workspace order alright after opening 92');
|
||||
|
||||
$i3->command("workspace 94")->recv;
|
||||
cmd "workspace 94";
|
||||
open_standard_window($x);
|
||||
check_order('workspace order alright after opening 94');
|
||||
|
||||
$i3->command("workspace 96")->recv;
|
||||
cmd "workspace 96";
|
||||
open_standard_window($x);
|
||||
check_order('workspace order alright after opening 96');
|
||||
|
||||
$i3->command("workspace foo")->recv;
|
||||
cmd "workspace foo";
|
||||
open_standard_window($x);
|
||||
check_order('workspace order alright after opening foo');
|
||||
|
||||
$i3->command("workspace 91")->recv;
|
||||
cmd "workspace 91";
|
||||
open_standard_window($x);
|
||||
check_order('workspace order alright after opening 91');
|
||||
|
||||
done_testing;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# vim:ts=4:sw=4:expandtab
|
||||
# Regression: Check if the focus stays the same when switching the layout
|
||||
# bug introduced by 77d0d42ed2d7ac8cafe267c92b35a81c1b9491eb
|
||||
use i3test tests => 4;
|
||||
use i3test;
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
|
||||
|
@ -23,8 +23,7 @@ sub check_order {
|
|||
cmp_deeply(\@nums, \@sorted, $msg);
|
||||
}
|
||||
|
||||
my $tmp = get_unused_workspace();
|
||||
$i3->command("workspace $tmp")->recv;
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
my $left = open_standard_window($x);
|
||||
sleep 0.25;
|
||||
|
@ -37,10 +36,12 @@ diag("left = " . $left->id . ", mid = " . $mid->id . ", right = " . $right->id);
|
|||
|
||||
is($x->input_focus, $right->id, 'Right window focused');
|
||||
|
||||
$i3->command('prev h')->recv;
|
||||
cmd 'prev h';
|
||||
|
||||
is($x->input_focus, $mid->id, 'Mid window focused');
|
||||
|
||||
$i3->command('layout stacked')->recv;
|
||||
cmd 'layout stacked';
|
||||
|
||||
is($x->input_focus, $mid->id, 'Mid window focused');
|
||||
|
||||
done_testing;
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#!perl
|
||||
# vim:ts=4:sw=4:expandtab
|
||||
# Tests resizing tiling containers
|
||||
use i3test tests => 6;
|
||||
use i3test;
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
|
||||
BEGIN {
|
||||
use_ok('X11::XCB::Window');
|
||||
|
@ -11,8 +10,7 @@ BEGIN {
|
|||
|
||||
my $x = X11::XCB::Connection->new;
|
||||
|
||||
my $tmp = get_unused_workspace();
|
||||
cmd "workspace $tmp";
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
cmd 'split v';
|
||||
|
||||
|
@ -47,3 +45,5 @@ cmd 'split h';
|
|||
|
||||
is($nodes->[0]->{percent}, 0.25, 'top window got only 25%');
|
||||
is($nodes->[1]->{percent}, 0.75, 'bottom window got 75%');
|
||||
|
||||
done_testing;
|
||||
|
|
|
@ -3,15 +3,15 @@
|
|||
#
|
||||
# Regression: move a floating window to a different workspace crashes i3
|
||||
#
|
||||
use i3test tests => 1;
|
||||
use X11::XCB qw(:all);
|
||||
use i3test;
|
||||
|
||||
my $tmp = get_unused_workspace();
|
||||
my $tmp = fresh_workspace;
|
||||
my $otmp = get_unused_workspace();
|
||||
cmd "workspace $tmp";
|
||||
|
||||
cmd 'open';
|
||||
cmd 'mode toggle';
|
||||
cmd "move workspace $otmp";
|
||||
|
||||
does_i3_live;
|
||||
|
||||
done_testing;
|
||||
|
|
|
@ -3,12 +3,9 @@
|
|||
#
|
||||
# Regression: floating windows are tiling after restarting, closing them crashes i3
|
||||
#
|
||||
use i3test tests => 1;
|
||||
use Time::HiRes qw(sleep);
|
||||
use X11::XCB qw(:all);
|
||||
use i3test;
|
||||
|
||||
my $tmp = get_unused_workspace();
|
||||
cmd "workspace $tmp";
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
cmd 'open';
|
||||
cmd 'mode toggle';
|
||||
|
@ -22,3 +19,5 @@ does_i3_live;
|
|||
|
||||
my $ws = get_ws($tmp);
|
||||
diag('ws = ' . Dumper($ws));
|
||||
|
||||
done_testing;
|
||||
|
|
|
@ -6,13 +6,10 @@
|
|||
# workspace as if a tiling container was closed, leading to the containers
|
||||
# taking much more space than they possibly could.
|
||||
#
|
||||
use i3test tests => 1;
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
use i3test;
|
||||
use List::Util qw(sum);
|
||||
|
||||
my $tmp = get_unused_workspace();
|
||||
cmd "workspace $tmp";
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
cmd 'exec /usr/bin/urxvt';
|
||||
sleep 0.5;
|
||||
|
@ -36,3 +33,5 @@ sleep 0.5;
|
|||
my $new_sum = sum map { $_->{rect}->{width} } @{$nodes};
|
||||
|
||||
is($old_sum, $new_sum, 'combined container width is still equal');
|
||||
|
||||
done_testing;
|
||||
|
|
|
@ -11,12 +11,11 @@
|
|||
# This testcase checks that the tree is properly flattened after moving.
|
||||
#
|
||||
use X11::XCB qw(:all);
|
||||
use i3test tests => 2;
|
||||
use i3test;
|
||||
|
||||
my $x = X11::XCB::Connection->new;
|
||||
|
||||
my $tmp = get_unused_workspace;
|
||||
cmd "workspace $tmp";
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
my $left = open_standard_window($x);
|
||||
sleep 0.25;
|
||||
|
@ -31,3 +30,5 @@ my $ws = get_ws($tmp);
|
|||
|
||||
is($ws->{orientation}, 'horizontal', 'workspace orientation is horizontal');
|
||||
is(@{$ws->{nodes}}, 3, 'all three windows on workspace level');
|
||||
|
||||
done_testing;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
use i3test tests => 5;
|
||||
use i3test;
|
||||
|
||||
BEGIN {
|
||||
use_ok('X11::XCB::Window');
|
||||
|
@ -11,8 +11,7 @@ BEGIN {
|
|||
|
||||
my $x = X11::XCB::Connection->new;
|
||||
|
||||
my $tmp = get_unused_workspace;
|
||||
cmd "workspace $tmp";
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
my $left = open_standard_window($x);
|
||||
sleep 0.25;
|
||||
|
@ -60,3 +59,5 @@ cmd 'mode toggle';
|
|||
my ($nodes, $focus) = get_ws_content($tmp);
|
||||
|
||||
is(@{$nodes->[1]->{nodes}}, 3, 'three windows in split con after mode toggle');
|
||||
|
||||
done_testing;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
use i3test tests => 3;
|
||||
use i3test;
|
||||
|
||||
BEGIN {
|
||||
use_ok('X11::XCB::Window');
|
||||
|
@ -14,8 +14,7 @@ BEGIN {
|
|||
|
||||
my $x = X11::XCB::Connection->new;
|
||||
|
||||
my $tmp = get_unused_workspace;
|
||||
cmd "workspace $tmp";
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
my $left = open_standard_window($x);
|
||||
sleep 0.25;
|
||||
|
@ -44,3 +43,5 @@ cmd 'move before v';
|
|||
sleep 0.25;
|
||||
|
||||
does_i3_live;
|
||||
|
||||
done_testing;
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
# another workspace.
|
||||
#
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
use i3test tests => 2;
|
||||
use i3test;
|
||||
|
||||
BEGIN {
|
||||
use_ok('X11::XCB::Window');
|
||||
|
@ -14,8 +13,7 @@ BEGIN {
|
|||
|
||||
my $x = X11::XCB::Connection->new;
|
||||
|
||||
my $tmp = get_unused_workspace;
|
||||
cmd "workspace $tmp";
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
# open a tiling window on the first workspace
|
||||
open_standard_window($x);
|
||||
|
@ -23,8 +21,7 @@ sleep 0.25;
|
|||
my $first = get_focused($tmp);
|
||||
|
||||
# on a different ws, open a floating window
|
||||
my $otmp = get_unused_workspace;
|
||||
cmd "workspace $otmp";
|
||||
my $otmp = fresh_workspace;
|
||||
open_standard_window($x);
|
||||
sleep 0.25;
|
||||
my $float = get_focused($otmp);
|
||||
|
@ -37,3 +34,5 @@ sleep 0.25;
|
|||
|
||||
# switch to the first ws and check focus
|
||||
is(get_focused($tmp), $float, 'floating client correctly focused');
|
||||
|
||||
done_testing;
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
# Regression test for inplace restarting with dock clients
|
||||
#
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
use i3test;
|
||||
|
||||
BEGIN {
|
||||
|
@ -14,8 +13,7 @@ BEGIN {
|
|||
my $x = X11::XCB::Connection->new;
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
|
||||
my $tmp = get_unused_workspace;
|
||||
cmd "workspace $tmp";
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
#####################################################################
|
||||
# verify that there is no dock window yet
|
||||
|
|
|
@ -3,12 +3,9 @@
|
|||
#
|
||||
# Regression test for setting a window to floating, tiling and opening a new window
|
||||
#
|
||||
use Time::HiRes qw(sleep);
|
||||
use i3test;
|
||||
|
||||
my $tmp = get_unused_workspace;
|
||||
cmd "workspace $tmp";
|
||||
|
||||
fresh_workspace;
|
||||
|
||||
cmd 'open';
|
||||
cmd 'mode toggle';
|
||||
|
|
|
@ -4,12 +4,9 @@
|
|||
# Regression test for using level-up to get to the 'content'-container and
|
||||
# toggle floating
|
||||
#
|
||||
use Time::HiRes qw(sleep);
|
||||
use i3test;
|
||||
|
||||
my $tmp = get_unused_workspace;
|
||||
cmd "workspace $tmp";
|
||||
|
||||
fresh_workspace;
|
||||
|
||||
cmd 'open';
|
||||
cmd 'level up';
|
||||
|
|
|
@ -3,12 +3,10 @@
|
|||
#
|
||||
# Test if the requested width/height is set after making the window floating.
|
||||
#
|
||||
use Time::HiRes qw(sleep);
|
||||
use X11::XCB qw(:all);
|
||||
use i3test;
|
||||
|
||||
my $tmp = get_unused_workspace;
|
||||
cmd "workspace $tmp";
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
my $x = X11::XCB::Connection->new;
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
# Regression test for closing one of multiple dock clients
|
||||
#
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
use i3test;
|
||||
|
||||
BEGIN {
|
||||
|
@ -14,8 +13,7 @@ BEGIN {
|
|||
my $x = X11::XCB::Connection->new;
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
|
||||
my $tmp = get_unused_workspace;
|
||||
cmd "workspace $tmp";
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
#####################################################################
|
||||
# verify that there is no dock window yet
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
# when setting the split container to floating
|
||||
#
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
use i3test;
|
||||
|
||||
BEGIN {
|
||||
|
@ -15,8 +14,7 @@ BEGIN {
|
|||
my $x = X11::XCB::Connection->new;
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
|
||||
my $tmp = get_unused_workspace;
|
||||
cmd "workspace $tmp";
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
#####################################################################
|
||||
# open a window with 200x80
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
# the time of launching the new one.
|
||||
#
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
use i3test;
|
||||
|
||||
BEGIN {
|
||||
|
@ -15,8 +14,7 @@ BEGIN {
|
|||
my $x = X11::XCB::Connection->new;
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
|
||||
my $tmp = get_unused_workspace;
|
||||
cmd "workspace $tmp";
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
#####################################################################
|
||||
# open the left window
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
# Regression test: level up should be a noop during fullscreen mode
|
||||
#
|
||||
use X11::XCB qw(:all);
|
||||
use Time::HiRes qw(sleep);
|
||||
use i3test;
|
||||
|
||||
BEGIN {
|
||||
|
@ -14,8 +13,7 @@ BEGIN {
|
|||
my $x = X11::XCB::Connection->new;
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
|
||||
my $tmp = get_unused_workspace;
|
||||
cmd "workspace $tmp";
|
||||
my $tmp = fresh_workspace;
|
||||
|
||||
#####################################################################
|
||||
# open a window, verify it’s not in fullscreen mode
|
||||
|
|
|
@ -13,7 +13,7 @@ use Time::HiRes qw(sleep);
|
|||
use v5.10;
|
||||
|
||||
use Exporter ();
|
||||
our @EXPORT = qw(get_workspace_names get_unused_workspace get_ws_content get_ws get_focused open_empty_con open_standard_window get_dock_clients cmd does_i3_live);
|
||||
our @EXPORT = qw(get_workspace_names get_unused_workspace fresh_workspace get_ws_content get_ws get_focused open_empty_con open_standard_window get_dock_clients cmd does_i3_live);
|
||||
|
||||
my $tester = Test::Builder->new();
|
||||
|
||||
|
@ -88,6 +88,12 @@ sub get_unused_workspace {
|
|||
$tmp
|
||||
}
|
||||
|
||||
sub fresh_workspace {
|
||||
my $unused = get_unused_workspace;
|
||||
cmd("workspace $unused");
|
||||
$unused
|
||||
}
|
||||
|
||||
sub get_ws {
|
||||
my ($name) = @_;
|
||||
my $i3 = i3("/tmp/nestedcons");
|
||||
|
|
Loading…
Reference in New Issue