2 # vim:ts=4:sw=4:expandtab
4 # Check if new containers are opened after the currently focused one instead
6 use List::Util qw(first);
9 my $i3 = i3(get_socket_path());
11 my $tmp = fresh_workspace;
13 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
15 # Open two new container
16 my $first = open_empty_con($i3);
18 ok(@{get_ws_content($tmp)} == 1, 'containers opened');
20 my $second = open_empty_con($i3);
22 isnt($first, $second, 'different container focused');
24 ##############################################################
25 # see if new containers open after the currently focused
26 ##############################################################
28 cmd qq|[con_id="$first"] focus|;
30 my $content = get_ws_content($tmp);
31 ok(@{$content} == 3, 'three containers opened');
33 is($content->[0]->{id}, $first, 'first container unmodified');
34 isnt($content->[1]->{id}, $second, 'second container replaced');
35 is($content->[2]->{id}, $second, 'third container unmodified');