]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/251-command-criteria-focused.t
match_matches_window: Check if focused->window exists
[i3/i3] / testcases / t / 251-command-criteria-focused.t
index 36c7b803fce78aca0d982ddff8470c06c1714a60..a880f591b72a9028fbd2e1183640ab2d7870173e 100644 (file)
@@ -2,13 +2,13 @@
 # vim:ts=4:sw=4:expandtab
 #
 # Please read the following documents before working on tests:
-# • http://build.i3wm.org/docs/testsuite.html
+# • https://build.i3wm.org/docs/testsuite.html
 #   (or docs/testsuite)
 #
-# • http://build.i3wm.org/docs/lib-i3test.html
+# • https://build.i3wm.org/docs/lib-i3test.html
 #   (alternatively: perldoc ./testcases/lib/i3test.pm)
 #
-# • http://build.i3wm.org/docs/ipc.html
+# • https://build.i3wm.org/docs/ipc.html
 #   (or docs/ipc)
 #
 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
@@ -105,6 +105,16 @@ is(@{get_ws($ws)->{nodes}}, 2, 'sanity check: workspace contains two windows');
 cmd '[workspace=__focused__] move to workspace trash';
 is(@{get_ws($ws)->{nodes}}, 0, '__focused__ works for workspace');
 
+###############################################################################
+# 6: Test that __focused__ in command criteria when no window is focused does
+# not crash i3.
+# See issue: #3406
+###############################################################################
+
+fresh_workspace;
+cmd '[class=__focused__] focus';
+does_i3_live;
+
 ###############################################################################
 
 done_testing;