X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F20-extended.t;h=779fe256da4602f18aee4fd8cf30cfd3e5d90103;hb=df2d2239c4e52ed9bf6891f03d6a3bb8e65a1297;hp=6cbb35386cc91b9ddb27e0940d30886c6b6d312a;hpb=46f546e3a234889baf70c76b9fcb4c3b9c9d14d7;p=perl%2Fmodules%2FLinux-SysInfo.git diff --git a/t/20-extended.t b/t/20-extended.t index 6cbb353..779fe25 100644 --- a/t/20-extended.t +++ b/t/20-extended.t @@ -5,21 +5,22 @@ use warnings; use Test::More; -use Linux::SysInfo qw/sysinfo LS_HAS_EXTENDED/; +use Linux::SysInfo qw; unless (LS_HAS_EXTENDED) { plan skip_all => 'your kernel does not support extended sysinfo fields'; } else { - plan tests => 4 * 5; + plan tests => 5 * 5; SKIP: { for my $run (0 .. 4) { my $si = sysinfo; - skip 'system error (sysinfo returned undef)' => (5 - $run) * 4 + skip 'system error (sysinfo returned undef)' => (5 - $run) * 5 unless defined $si; is ref($si), 'HASH', "sysinfo returns a hash reference at run $run"; + is scalar(keys %$si), 14, "sysinfo object has the right number of keys at run $run"; - for (qw/totalhigh freehigh mem_unit/) { + for (qw) { if (defined $si->{$_}) { like $si->{$_}, qr/^\d+(?:\.\d+)?$/, "key $_ looks like a number at run $run";