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