i3/testcases/t/172-start-on-named-ws.t
Maik Fischer 8349190e09 testcases: always start i3 through i3test::launch_with_config
this will pave the way to just call BAIL_OUT and stop the currently
running testfile if i3 died for whatever reason.
2011-12-04 14:14:20 +01:00

60 lines
1.6 KiB
Perl

#!perl
# vim:ts=4:sw=4:expandtab
# checks if i3 starts up on workspace '1' or the first configured named workspace
#
use i3test i3_autostart => 0;
##############################################################
# 1: i3 should start with workspace '1'
##############################################################
my $config = <<EOT;
# i3 config file (v4)
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
EOT
my $pid = launch_with_config($config);
my @names = @{get_workspace_names()};
is_deeply(\@names, [ '1' ], 'i3 starts on workspace 1 without any configuration');
exit_gracefully($pid);
##############################################################
# 2: with named workspaces, i3 should start on the first named one
##############################################################
$config = <<EOT;
# i3 config file (v4)
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
bindsym Mod1+1 workspace foobar
EOT
$pid = launch_with_config($config);
@names = @{get_workspace_names()};
is_deeply(\@names, [ 'foobar' ], 'i3 starts on named workspace foobar');
exit_gracefully($pid);
##############################################################
# 3: the same test as 2, but with a quoted workspace name
##############################################################
$config = <<EOT;
# i3 config file (v4)
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
bindsym Mod1+1 workspace "foobar"
EOT
$pid = launch_with_config($config);
@names = @{get_workspace_names()};
is_deeply(\@names, [ 'foobar' ], 'i3 starts on named workspace foobar');
exit_gracefully($pid);
done_testing;