]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/130-close-empty-split.t
Merge pull request #3178 from orestisf1993/pr-2314
[i3/i3] / testcases / t / 130-close-empty-split.t
index ce9ebd7a16afa79e6dd79f4c0af26d51c68d41bf..2e3cb7947feecb0f10523bfc3b20a5fac4966234 100644 (file)
@@ -1,6 +1,19 @@
 #!perl
 # vim:ts=4:sw=4:expandtab
 #
+# Please read the following documents before working on tests:
+# • https://build.i3wm.org/docs/testsuite.html
+#   (or docs/testsuite)
+#
+# • https://build.i3wm.org/docs/lib-i3test.html
+#   (alternatively: perldoc ./testcases/lib/i3test.pm)
+#
+# • https://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;
@@ -22,10 +35,10 @@ my ($nodes, $focus) = get_ws_content($tmp);
 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);
 
@@ -40,6 +53,11 @@ cmd 'kill';
 ($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
@@ -60,10 +78,10 @@ cmd 'split v';
 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);