Commits

Palmer, 2E0EOL committed 8ebb2c7 Draft

Fix unit test processing bugs.

Comments (0)

Files changed (1)

t/check_disks_zpool.t

 
 	my $testdir = 'testdata/check_disks_zpool';
 	if ( opendir(my $d, $testdir) ) {
-		my %dentries;
+		my ( %dentries, %dentries_codes );
 		while ( my $ent = readdir($d) ) {
 			my $filename = "$testdir/$ent";
 			next if ( $ent =~ m/^\./ );
 			if ( $ent =~ m/^(\d{1,2})\_(\w+)\.txt$/ ) {
-				$dentries{$1} = $filename;
+				$dentries{$1} = $ent;
+				$dentries_codes{$1} = $fn_ec_map{$2};
 				next;
 			}
 			warn "Not running unit test $ent";
 		foreach my $testn ( sort { $a <=> $b } ( keys(%dentries) ) ) {
 			my $ent = $dentries{$testn};
 			my $filename = "$testdir/$ent";
-			my $expect_exit = $fn_ec_map{$testn};
-			if ( !$expect_exit ) {
+			my $expect_exit = $dentries_codes{$testn};
+			if ( !defined($expect_exit) ) {
 				warn "Not running unit test (unknown filename): $ent";
 				next;
 			}