#!perl
# vim:ts=4:sw=4:expandtab
#
+# Please read the following documents before working on tests:
+# • http://build.i3wm.org/docs/testsuite.html
+# (or docs/testsuite)
+#
+# • http://build.i3wm.org/docs/lib-i3test.html
+# (alternatively: perldoc ./testcases/lib/i3test.pm)
+#
+# • http://build.i3wm.org/docs/ipc.html
+# (or docs/ipc)
+#
+# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
+# (unless you are already familiar with Perl)
+#
# Check if empty split containers are automatically closed.
#
use i3test;
is($nodes->[0]->{focused}, 0, 'split container not focused');
# focus the split container
-cmd 'level up';
+cmd 'focus parent';
($nodes, $focus) = get_ws_content($tmp);
my $split = $focus->[0];
-cmd 'level down';
+cmd 'focus child';
$second = open_empty_con($i3);
($nodes, $focus) = get_ws_content($tmp);
isnt($nodes->[0]->{id}, $split, 'split container closed');
+# clean up the remaining containers to ensure this workspace will be garbage
+# collected.
+cmd 'kill';
+cmd 'kill';
+
##############################################################
# same thing but this time we are moving the cons away instead
# of killing them
is($nodes->[0]->{focused}, 0, 'split container not focused');
# focus the split container
-cmd 'level up';
+cmd 'focus parent';
($nodes, $focus) = get_ws_content($tmp);
$split = $focus->[0];
-cmd 'level down';
+cmd 'focus child';
$second = open_empty_con($i3);