]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/522-rename-assigned-workspace.t
Allow multiple assignments of workspaces to outputs
[i3/i3] / testcases / t / 522-rename-assigned-workspace.t
index f6319729873209ed2d765ccf044c195f4b254a92..824f4a062ddba6be888842425c9fe69ed6e1f280 100644 (file)
@@ -29,6 +29,8 @@ workspace 2 output fake-1
 workspace 3:foo output fake-1
 workspace baz output fake-1
 workspace 5 output left
+workspace 6 output doesnotexist fake-0
+workspace 7 output fake-1 fake-0
 EOT
 
 ##########################################################################
@@ -91,4 +93,24 @@ cmd 'rename workspace 5 to 2';
 is(get_output_for_workspace('2'), 'fake-1',
     'Renaming a workspace so that it moves to the focused output which contains only an empty workspace should replace the empty workspace');
 
+##########################################################################
+# Renaming a workspace with multiple assignments, where the first output
+# doesn't exist.
+##########################################################################
+
+cmd 'focus output fake-1';
+cmd 'rename workspace to 6';
+is(get_output_for_workspace('6'), 'fake-0',
+   'Renaming the workspace while first target output doesn\'t exist moves it to the second assigned output');
+
+##########################################################################
+# Renaming a workspace with multiple assignments, where both outputs exist
+# moves it to the first output.
+##########################################################################
+
+cmd 'focus output fake-0';
+cmd 'rename workspace to 7';
+is(get_output_for_workspace('7'), 'fake-1',
+   'Renaming a workspace with multiple assignments, where both outputs exist moves it to the first output.');
+
 done_testing;