Silence "masks earlier declaration in same scope" warnings when executing tests.
This commit is contained in:
@ -20,6 +20,8 @@
|
||||
use i3test i3_autostart => 0;
|
||||
use File::Temp qw(tempfile);
|
||||
|
||||
my ($cfg, $ret, $out);
|
||||
|
||||
sub check_config {
|
||||
my ($config) = @_;
|
||||
my ($fh, $tmpfile) = tempfile(UNLINK => 1);
|
||||
@ -35,12 +37,12 @@ sub check_config {
|
||||
# 1: test with a bogus configuration file
|
||||
################################################################################
|
||||
|
||||
my $cfg = <<EOT;
|
||||
$cfg = <<EOT;
|
||||
# i3 config file (v4)
|
||||
i_am_an_unknown_config option
|
||||
EOT
|
||||
|
||||
my ($ret, $out) = check_config($cfg);
|
||||
($ret, $out) = check_config($cfg);
|
||||
is($ret, 1, "exit code == 1");
|
||||
like($out, qr/ERROR: *CONFIG: *[Ee]xpected.*tokens/, 'bogus config file');
|
||||
|
||||
@ -48,12 +50,12 @@ like($out, qr/ERROR: *CONFIG: *[Ee]xpected.*tokens/, 'bogus config file');
|
||||
# 2: test with a valid configuration file
|
||||
################################################################################
|
||||
|
||||
my $cfg = <<EOT;
|
||||
$cfg = <<EOT;
|
||||
# i3 config file (v4)
|
||||
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
|
||||
EOT
|
||||
|
||||
my ($ret, $out) = check_config($cfg);
|
||||
($ret, $out) = check_config($cfg);
|
||||
is($ret, 0, "exit code == 0");
|
||||
is($out, "", 'valid config file');
|
||||
|
||||
|
Reference in New Issue
Block a user