Make "[move] workspace number" accept a default ws name after the ws number

This commit is contained in:
Sebastian Ullrich
2012-08-31 20:19:27 +02:00
committed by Michael Stapelberg
parent c69fba3662
commit 236f9f45e3
4 changed files with 60 additions and 11 deletions

View File

@ -156,6 +156,34 @@ ok(!workspace_exists('5'), 'workspace 5 does not exist');
cmd 'workspace number 5';
ok(workspace_exists('5'), 'workspace 5 was created');
################################################################################
# Check that we can go to workspace "7: foo" with the command
# "workspace number 7: bar", i.e. the additional workspace name is ignored.
################################################################################
ok(!workspace_exists('7'), 'workspace 7 does not exist');
ok(!workspace_exists('7: bar'), 'workspace 7: bar does not exist');
ok(!workspace_exists('7: foo'), 'workspace 7: foo does not exist yet');
cmd 'workspace 7: foo';
ok(workspace_exists('7: foo'), 'workspace 7: foo was created');
cmd 'open';
cmd 'workspace 6';
ok(workspace_exists('7: foo'), 'workspace 7: foo still open');
cmd 'workspace number 7: bar';
is(focused_ws(), '7: foo', 'now on workspace 7: foo');
ok(!workspace_exists('7'), 'workspace 7 still does not exist');
ok(!workspace_exists('7: bar'), 'workspace 7: bar still does not exist');
################################################################################
# Check that "workspace number 8: foo" will create workspace "8: foo" if it
# does not yet exist (just like "workspace 8: foo" would).
################################################################################
ok(!workspace_exists('8: foo'), 'workspace 8: foo does not exist');
cmd 'workspace number 8: foo';
ok(workspace_exists('8: foo'), 'workspace 8: foo was created');
################################################################################
# Verify that renaming workspaces works.
################################################################################

View File

@ -79,6 +79,28 @@ is_num_children('12', 0, 'no container on 12 anymore');
ok(!workspace_exists('13'), 'workspace 13 does still not exist');
################################################################################
# Check that 'move to workspace number <number><name>' works to move a window to
# named workspaces which start with <number>.
################################################################################
cmd 'workspace 15: meh';
cmd 'open';
is_num_children('15: meh', 1, 'one container on 15: meh');
ok(!workspace_exists('15'), 'workspace 15 does not exist yet');
ok(!workspace_exists('15: duh'), 'workspace 15: duh does not exist yet');
cmd 'workspace 14';
cmd 'open';
cmd 'move to workspace number 15: duh';
is_num_children('15: meh', 2, 'two containers on 15: meh');
is_num_children('14', 0, 'no container on 14 anymore');
ok(!workspace_exists('15'), 'workspace 15 does still not exist');
ok(!workspace_exists('15: duh'), 'workspace 15 does still not exist');
###################################################################
# check if 'move workspace next' and 'move workspace prev' work
###################################################################