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 # checks if i3 starts up on workspace '1' or the first configured named workspace
19 use i3test i3_autostart => 0;
21 ##############################################################
22 # 1: i3 should start with workspace '1'
23 ##############################################################
27 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
30 my $pid = launch_with_config($config);
32 my @names = @{get_workspace_names()};
33 is_deeply(\@names, [ '1' ], 'i3 starts on workspace 1 without any configuration');
35 exit_gracefully($pid);
37 ##############################################################
38 # 2: with named workspaces, i3 should start on the first named one
39 ##############################################################
43 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
45 bindsym Mod1+1 workspace foobar
48 $pid = launch_with_config($config);
50 @names = @{get_workspace_names()};
51 is_deeply(\@names, [ 'foobar' ], 'i3 starts on named workspace foobar');
53 exit_gracefully($pid);
55 ##############################################################
56 # 3: the same test as 2, but with a quoted workspace name
57 ##############################################################
61 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
63 bindsym Mod1+1 workspace "foobar"
66 $pid = launch_with_config($config);
68 @names = @{get_workspace_names()};
69 is_deeply(\@names, [ 'foobar' ], 'i3 starts on named workspace foobar');
71 exit_gracefully($pid);