t/00-module.t
changeset 1 d2562d0417a9
parent 0 8220abbf27bb
child 2 ba9ad363d185
equal deleted inserted replaced
0:8220abbf27bb 1:d2562d0417a9
       
     1 use 5.010;
     1 use strict;
     2 use strict;
     2 use warnings;
     3 use warnings;
     3 use Test::More;
     4 use Test::More;
       
     5 use autodie qw(:all);
     4 
     6 
     5 BEGIN {
     7 BEGIN {
     6     use_ok "BlockDev";
     8     use_ok "BlockDev";
     7 }
     9 }
     8 
    10 
       
    11 my @devices = BlockDev->list();
       
    12 {   # device list
       
    13 
       
    14     my @proc = ();
       
    15     open(my $fh, "/proc/partitions");
       
    16     while (<$fh>) {
       
    17 	/^\s*(\d+\s+){3}(?<dev>\S+)/ or next;
       
    18 	push @proc => $+{dev};
       
    19     }
       
    20     is_deeply(\@devices => \@proc, "got all devices");
       
    21 }
       
    22 
     9 done_testing();
    23 done_testing();