2010-07-03 17:42:36 +02:00
|
|
|
#!perl
|
|
|
|
# vim:ts=4:sw=4:expandtab
|
|
|
|
#
|
|
|
|
# Check if new containers are opened after the currently focused one instead
|
|
|
|
# of always at the end
|
|
|
|
use List::Util qw(first);
|
2011-03-09 20:25:17 +01:00
|
|
|
use i3test;
|
2010-07-03 17:42:36 +02:00
|
|
|
|
2011-07-25 13:35:56 +02:00
|
|
|
my $i3 = i3(get_socket_path());
|
2010-07-03 17:42:36 +02:00
|
|
|
|
2011-03-09 20:25:17 +01:00
|
|
|
my $tmp = fresh_workspace;
|
2010-07-03 17:42:36 +02:00
|
|
|
|
|
|
|
ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
|
|
|
|
|
|
|
|
# Open two new container
|
2010-07-17 15:52:22 +02:00
|
|
|
my $first = open_empty_con($i3);
|
2010-07-03 17:42:36 +02:00
|
|
|
|
|
|
|
ok(@{get_ws_content($tmp)} == 1, 'containers opened');
|
|
|
|
|
2010-07-17 15:52:22 +02:00
|
|
|
my $second = open_empty_con($i3);
|
2010-07-03 17:42:36 +02:00
|
|
|
|
|
|
|
isnt($first, $second, 'different container focused');
|
|
|
|
|
|
|
|
##############################################################
|
|
|
|
# see if new containers open after the currently focused
|
|
|
|
##############################################################
|
|
|
|
|
2011-03-09 20:25:17 +01:00
|
|
|
cmd qq|[con_id="$first"] focus|;
|
|
|
|
cmd 'open';
|
2011-11-21 21:04:00 +01:00
|
|
|
my $content = get_ws_content($tmp);
|
2010-07-03 17:42:36 +02:00
|
|
|
ok(@{$content} == 3, 'three containers opened');
|
|
|
|
|
|
|
|
is($content->[0]->{id}, $first, 'first container unmodified');
|
|
|
|
isnt($content->[1]->{id}, $second, 'second container replaced');
|
|
|
|
is($content->[2]->{id}, $second, 'third container unmodified');
|
|
|
|
|
2011-03-09 20:25:17 +01:00
|
|
|
done_testing;
|