1# Before 'make install' is performed this script should be runnable with 2# 'make test'. After 'make install' it should work as 'perl Filesys-di.t' 3 4######################### 5 6use strict; 7use warnings; 8 9use Test::More; 10BEGIN { use_ok( 'Filesys::di', qw(diskspace) ); } 11#use Data::Dumper; 12 13######################### 14 15# Insert your test code below, the Test::More module is use()ed here so read 16# its man page ( perldoc Test::More ) for help writing this test script. 17 18my $h = diskspace (''); 19my @a = keys %{$h}; 20ok ($#a > 0, 'standard'); 21$h = diskspace ('-d 1 -f buvp'); 22@a = keys %{$h}; 23my $path = '/'; 24if (! exists($h->{$path})) { 25 $path = 'C:\\'; 26} 27my $disp = $h->{$path}->{'display'}; 28my $count = $#{$h->{$path}->{'display'}}; 29ok ($#a > 0 && $count == 3, 'with arguments'); 30my $val = $h->{$path}->{'display'}[1]; 31ok ($#a > 0 && $count == 3 && $val =~ /^\d+$/, 'has a value'); 32done_testing(); 33