2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • http://build.i3wm.org/docs/ipc.html
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 # (unless you are already familiar with Perl)
17 # Test that `workspace {N}` acts like `workspace number {N}` when N is a plain
18 # digit, and likewise for `move to workspace {N}`.
20 # Bug still in: 4.8-16-g3f5a0f0
23 cmd 'workspace 5:foo';
28 is(focused_ws, '5:foo',
29 'a command to switch to a workspace with a bare number should switch to a workspace of that number');
32 my $win = open_window;
33 cmd '[id="' . $win->{id} . '"] move to workspace 5';
35 is(@{get_ws('5:foo')->{nodes}}, 2,
36 'a command to move a container to a workspace with a bare number should move that container to a workspace of that number');
41 cmd 'workspace 7:foo';
46 'a workspace with a name that is a matching plain number should be preferred when switching');
48 cmd '[id="' . $win->{id} . '"] move to workspace 7';
49 is(@{get_ws('7')->{nodes}}, 2,
50 'a workspace with a name that is a matching plain number should be preferred when moving');