]> git.sur5r.net Git - i3/i3/blob - testcases/t/128-open-order.t
Merge branch 'master' into next
[i3/i3] / testcases / t / 128-open-order.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 #
4 # Check if new containers are opened after the currently focused one instead
5 # of always at the end
6 use List::Util qw(first);
7 use i3test;
8
9 my $i3 = i3(get_socket_path());
10
11 my $tmp = fresh_workspace;
12
13 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
14
15 # Open two new container
16 my $first = open_empty_con($i3);
17
18 ok(@{get_ws_content($tmp)} == 1, 'containers opened');
19
20 my $second = open_empty_con($i3);
21
22 isnt($first, $second, 'different container focused');
23
24 ##############################################################
25 # see if new containers open after the currently focused
26 ##############################################################
27
28 cmd qq|[con_id="$first"] focus|;
29 cmd 'open';
30 my $content = get_ws_content($tmp);
31 ok(@{$content} == 3, 'three containers opened');
32
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');
36
37 done_testing;