From 5872cbcba6c3bf9ccca1ae2ab0ee8a52113cbcf8 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 28 Nov 2010 21:16:58 +0100 Subject: [PATCH] tests: fix t/29-focus-after-close.t to correctly open a split container --- testcases/t/29-focus-after-close.t | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/testcases/t/29-focus-after-close.t b/testcases/t/29-focus-after-close.t index d189ead6..3370484c 100644 --- a/testcases/t/29-focus-after-close.t +++ b/testcases/t/29-focus-after-close.t @@ -15,19 +15,20 @@ $i3->command("workspace $tmp")->recv; ok(@{get_ws_content($tmp)} == 0, 'no containers yet'); my $first = open_empty_con($i3); +my $second = open_empty_con($i3); $i3->command('split v')->recv; my ($nodes, $focus) = get_ws_content($tmp); -is($nodes->[0]->{focused}, 0, 'split container not focused'); +is($nodes->[1]->{focused}, 0, 'split container not focused'); $i3->command('level up')->recv; ($nodes, $focus) = get_ws_content($tmp); -is($nodes->[0]->{focused}, 1, 'split container focused after level up'); +is($nodes->[1]->{focused}, 1, 'split container focused after level up'); -my $second = open_empty_con($i3); +my $third = open_empty_con($i3); -isnt($first, $second, 'different container focused'); +isnt(get_focused($tmp), $second, 'different container focused'); # We have the following layout now (con is focused): # .----------------. @@ -47,8 +48,8 @@ $i3->command('kill')->recv; # sleep is missing. why? sleep 0.25; ($nodes, $focus) = get_ws_content($tmp); -is($nodes->[0]->{nodes}->[0]->{id}, $first, 'first container found'); -is($nodes->[0]->{nodes}->[0]->{focused}, 1, 'first container focused'); +is($nodes->[1]->{nodes}->[0]->{id}, $second, 'second container found'); +is($nodes->[1]->{nodes}->[0]->{focused}, 1, 'second container focused'); ############################################################## # another case, using a slightly different layout (regression)