2 # vim:ts=4:sw=4:expandtab
4 # Tests focus switching (next/prev)
8 my $tmp = fresh_workspace;
10 ######################################################################
11 # Open one container, verify that 'focus down' and 'focus right' do nothing
12 ######################################################################
15 my ($nodes, $focus) = get_ws_content($tmp);
16 my $old_focused = $focus->[0];
19 ($nodes, $focus) = get_ws_content($tmp);
20 is($focus->[0], $old_focused, 'focus did not change with only one con');
23 ($nodes, $focus) = get_ws_content($tmp);
24 is($focus->[0], $old_focused, 'focus did not change with only one con');
26 ######################################################################
27 # Open another container, verify that 'focus right' switches
28 ######################################################################
29 my $left = $old_focused;
32 ($nodes, $focus) = get_ws_content($tmp);
33 isnt($old_focused, $focus->[0], 'new container is focused');
34 my $mid = $focus->[0];
37 ($nodes, $focus) = get_ws_content($tmp);
38 isnt($old_focused, $focus->[0], 'new container is focused');
39 my $right = $focus->[0];
42 ($nodes, $focus) = get_ws_content($tmp);
43 isnt($focus->[0], $right, 'focus did change');
44 is($focus->[0], $left, 'left container focused (wrapping)');
47 ($nodes, $focus) = get_ws_content($tmp);
48 is($focus->[0], $mid, 'middle container focused');
51 ($nodes, $focus) = get_ws_content($tmp);
52 is($focus->[0], $right, 'right container focused');
55 ($nodes, $focus) = get_ws_content($tmp);
56 is($focus->[0], $mid, 'middle container focused');
59 ($nodes, $focus) = get_ws_content($tmp);
60 is($focus->[0], $left, 'left container focused');
63 ($nodes, $focus) = get_ws_content($tmp);
64 is($focus->[0], $right, 'right container focused');
67 ######################################################################
69 ######################################################################
71 cmd qq|[con_id="$mid"] focus|;
72 ($nodes, $focus) = get_ws_content($tmp);
73 is($focus->[0], $mid, 'middle container focused');