]> git.sur5r.net Git - i3/i3/blob - testcases/t/172-start-on-named-ws.t
42a444592bccb4fef7f90e7b3bea9d5d3f3e3830
[i3/i3] / testcases / t / 172-start-on-named-ws.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 # checks if i3 starts up on workspace '1' or the first configured named workspace
4 #
5 use i3test i3_autostart => 0;
6
7 ##############################################################
8 # 1: i3 should start with workspace '1'
9 ##############################################################
10
11 my $config = <<EOT;
12 # i3 config file (v4)
13 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
14 EOT
15
16 my $pid = launch_with_config($config);
17
18 my @names = @{get_workspace_names()};
19 is_deeply(\@names, [ '1' ], 'i3 starts on workspace 1 without any configuration');
20
21 exit_gracefully($pid);
22
23 ##############################################################
24 # 2: with named workspaces, i3 should start on the first named one
25 ##############################################################
26
27 $config = <<EOT;
28 # i3 config file (v4)
29 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
30
31 bindsym Mod1+1 workspace foobar
32 EOT
33
34 $pid = launch_with_config($config);
35
36 @names = @{get_workspace_names()};
37 is_deeply(\@names, [ 'foobar' ], 'i3 starts on named workspace foobar');
38
39 exit_gracefully($pid);
40
41 ##############################################################
42 # 3: the same test as 2, but with a quoted workspace name
43 ##############################################################
44
45 $config = <<EOT;
46 # i3 config file (v4)
47 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
48
49 bindsym Mod1+1 workspace "foobar"
50 EOT
51
52 $pid = launch_with_config($config);
53
54 @names = @{get_workspace_names()};
55 is_deeply(\@names, [ 'foobar' ], 'i3 starts on named workspace foobar');
56
57 exit_gracefully($pid);
58
59 done_testing;