From 1e65efa6a3d996c34c902f2b04257307c2175776 Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Sat, 10 Dec 2011 19:28:30 +0000 Subject: more code style fixes (perl_checker & tv) --- t/000_test_env.t | 2 +- t/001_check_file.t | 22 +++++++++++----------- t/003_is_hybrid.t | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 't') diff --git a/t/000_test_env.t b/t/000_test_env.t index 9ad445d..cf7abc2 100644 --- a/t/000_test_env.t +++ b/t/000_test_env.t @@ -30,7 +30,7 @@ my ($image_path) = @ARGV; is($ENV{USERNAME}, 'root', "Current user is root."); # TODO move this elsewhere maybe? -sub pkg_check { my ($pkg) = @_; return system("rpm -q $pkg >/dev/null"); } +sub pkg_check { my ($pkg) = @_; return system("rpm -q $pkg >/dev/null") } my @packages = qw(cdrkit cdrkit-isotools gnupg); diff --git a/t/001_check_file.t b/t/001_check_file.t index ce36df0..022a8d7 100644 --- a/t/001_check_file.t +++ b/t/001_check_file.t @@ -34,7 +34,7 @@ bail_on_fail; if (scalar %info) { pass 'ISO has valid filename.'; while (my ($k, $v) = each %info) { - note uc($k), "=$v\n"; + note uc($k), "=$v\n" if defined $v; } } else { fail 'ISO has valid filename.'; @@ -42,7 +42,7 @@ if (scalar %info) { } # are files available? -ok -r $image_path, 'ISO file is readable.' +ok(-r $image_path, 'ISO file is readable.') or diag("$image_path: $!"); # is file size correct? @@ -52,19 +52,19 @@ my $size = $size_name[0]; # Correct sizes: CD == 700MB & DVD == 4,700.373MB my %max_sizes = ("CD" => "700MB", "DVD" => "4700MB"); -ok $size le $max_sizes{$info{medium}}, +ok($size le $max_sizes{$info{medium}}, sprintf("File has a working size (%s) for its medium type (%s, max %s).", - $size, $info{medium}, $max_sizes{$info{medium}}); + $size, $info{medium}, $max_sizes{$info{medium}})); # -ok -r $image_path . '.md5', 'MD5 checksum is available.'; -ok -r $image_path . '.sha1', 'SHA1 checkum is available.'; +ok(-r $image_path . '.md5', 'MD5 checksum is available.'); +ok(-r $image_path . '.sha1', 'SHA1 checkum is available.'); TODO: { local $TODO = ".idx & .lst" if 1; - ok -r $image_path, '.idx list file is available.'; - ok -r $image_path, '.lst list file is available.'; + ok(-r $image_path, '.idx list file is available.'); + ok(-r $image_path, '.lst list file is available.'); } @@ -82,7 +82,7 @@ is($md5, $md5file, 'MD5/.md5 checksums match.'); my $sha1 = $ts[0]; @ts = split(/ /, `cat $sha1file`); $sha1file = $ts[0]; -is $sha1, $sha1file, 'SHA1/.sha1 checksums match.'; +is($sha1, $sha1file, 'SHA1/.sha1 checksums match.'); # check ISO header info @@ -94,7 +94,7 @@ my %isoValues = ( "Volume set id", "$info{name} $info{version} $info{release} $info{variant} $info{arch} $info{medium}", # TODO $info{'build'} ? "Publisher id", "Mageia.Org", "Data preparer id", "", # ? - "Copyright File id", "http://www.mageia.org/2/license/" + "Copyright File id", "http://www.mageia.org/2/license/", "Abstract File id", "http://www.mageia.org/2/" ); @@ -120,7 +120,7 @@ my $result = `cat is_burnable.log | grep overburn | wc -l | tr -d '\n'`; -r "is_burnable.log" and system "rm is_burnable.log"; -is $result, 0, "ISO can be burnt."; +is($result, 0, "ISO can be burnt."); done_testing(); diff --git a/t/003_is_hybrid.t b/t/003_is_hybrid.t index c1b0c25..dd89fd7 100644 --- a/t/003_is_hybrid.t +++ b/t/003_is_hybrid.t @@ -24,7 +24,7 @@ bail_on_fail; my ($image_path) = @ARGV; -ok is_hybrid($image_path, 0), "Is hybrid"; +ok(is_hybrid($image_path, 0), "Is hybrid"); # Verification if the ISO is hybrid sub is_hybrid { -- cgit v1.2.1