Silence "masks earlier declaration in same scope" warnings when executing tests.

This commit is contained in:
Ingo Bürk
2015-06-12 18:19:43 +02:00
parent 1d4b5863a5
commit 73a84886d1
9 changed files with 80 additions and 71 deletions

View File

@ -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');