2 # vim:ts=4:sw=4:expandtab
4 # Regression test: New windows were not opened in the correct place if they
5 # matched an assignment.
6 # Wrong behaviour manifested itself up to (including) commit
7 # f78caf8c5815ae7a66de9e4b734546fd740cc19d
9 use i3test i3_autostart => 0;
13 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
15 assign [title="testcase"] targetws
18 my $pid = launch_with_config($config);
20 my $i3 = i3(get_socket_path(0));
22 cmd 'workspace targetws';
24 open_window(name => "testcase");
26 my $nodes = get_ws_content('targetws');
27 is(scalar @$nodes, 1, 'precisely one window');
29 open_window(name => "testcase");
31 $nodes = get_ws_content('targetws');
32 is(scalar @$nodes, 2, 'precisely two windows');
36 open_window(name => "testcase");
38 $nodes = get_ws_content('targetws');
39 is(scalar @$nodes, 2, 'still two windows');
41 # focus parent. the new window should now be opened right next to the last one.
44 open_window(name => "testcase");
46 $nodes = get_ws_content('targetws');
47 is(scalar @$nodes, 3, 'new window opened next to last one');
49 exit_gracefully($pid);