]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/255-multiple-marks.t
tree_move: Don't change focus order when swapping containers
[i3/i3] / testcases / t / 255-multiple-marks.t
index d6d86e2343265db607b7d2fb192edf29d7d6ae1f..61fac0069325f0014f9dc12ef989323114c4c65b 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
@@ -38,8 +38,8 @@ sub get_mark_for_window_on_workspace {
 
 $ws = fresh_workspace;
 $con = open_window;
-cmd 'mark A';
-cmd 'mark B';
+cmd 'mark --add A';
+cmd 'mark --add B';
 
 is_deeply(sort(get_marks()), [ 'A', 'B' ], 'both marks exist');
 is_deeply(get_mark_for_window_on_workspace($ws, $con), [ 'A', 'B' ], 'both marks are on the same window');
@@ -54,9 +54,9 @@ $ws = fresh_workspace;
 $con = open_window;
 cmd 'mark A';
 
-cmd 'mark --toggle B';
+cmd 'mark --add --toggle B';
 is_deeply(get_mark_for_window_on_workspace($ws, $con), [ 'A', 'B' ], 'both marks are on the same window');
-cmd 'mark --toggle B';
+cmd 'mark --add --toggle B';
 is_deeply(get_mark_for_window_on_workspace($ws, $con), [ 'A' ], 'only mark B has been removed');
 
 cmd 'unmark';
@@ -67,9 +67,9 @@ cmd 'unmark';
 
 $ws = fresh_workspace;
 $con = open_window;
-cmd 'mark A';
-cmd 'mark B';
-cmd 'mark C';
+cmd 'mark --add A';
+cmd 'mark --add B';
+cmd 'mark --add C';
 
 cmd 'unmark B';
 is_deeply(get_mark_for_window_on_workspace($ws, $con), [ 'A', 'C' ], 'only mark B has been removed');
@@ -82,15 +82,36 @@ cmd 'unmark';
 
 $ws = fresh_workspace;
 $con = open_window;
-cmd 'mark A';
-cmd 'mark B';
+cmd 'mark --add A';
+cmd 'mark --add B';
 open_window;
 
-cmd '[con_mark=B] mark C';
+cmd '[con_mark=B] mark --add C';
 is_deeply(get_mark_for_window_on_workspace($ws, $con), [ 'A', 'B', 'C' ], 'matching on a mark works with multiple marks');
 
 cmd 'unmark';
 
+###############################################################################
+# Verify that "unmark" can be matched on the focused window.
+###############################################################################
+
+$ws = fresh_workspace;
+$con = open_window;
+cmd 'mark --add A';
+cmd 'mark --add B';
+open_window;
+cmd 'mark --add C';
+cmd 'mark --add D';
+
+is_deeply(sort(get_marks()), [ 'A', 'B', 'C', 'D' ], 'all marks exist');
+
+cmd '[con_id=__focused__] unmark';
+
+is_deeply(sort(get_marks()), [ 'A', 'B' ], 'marks on the unfocused window still exist');
+is_deeply(get_mark_for_window_on_workspace($ws, $con), [ 'A', 'B' ], 'matching on con_id=__focused__ works for unmark');
+
+cmd 'unmark';
+
 ###############################################################################
 
 done_testing;