Commits

Anonymous committed f0796fe

Extracted the _get_failed_struct() method.

Comments (0)

Files changed (1)

modules/Test-Shlomif-Harness/lib/Test/Shlomif/Harness/Obj.pm

          };
 }
 
+sub _get_failed_struct
+{
+    my ($self, %args) = @_;
+    if ($args{'wstatus'}) {
+         return
+            $self->_dubious_return(
+                %args
+                );
+    }
+    elsif($args{'results'}->{seen}) {
+        return
+            $self->_failed_with_results_seen(
+                %args,
+            );
+    }
+    else {
+        return
+            $self->_failed_before_any_test_output(
+                %args,
+            );
+    }
+}
+
 sub _run_single_test
 {
     my ($self, %args) = @_;
                 push @{$test{failed}}, $overrun
             }
         }
-
-        if ($wstatus) {
-             $test_file_struct =
-                $self->_dubious_return(
-                    test_struct => \%test,
-                    estatus => $estatus,
-                    wstatus => $wstatus,
-                    filename => $tfile,
-                    );
-        }
-        elsif($results{seen}) {
-            $test_file_struct =
-                $self->_failed_with_results_seen(
-                    test_struct => \%test,
-                    filename => $tfile,
-                );
-        }
-        else {
-            $test_file_struct =
-                $self->_failed_before_any_test_output(
-                    test_struct => \%test,
-                    filename => $tfile,                    
-                );
-        }
-        $self->failed_tests()->{$tfile} = $test_file_struct;
+ 
+        $self->failed_tests()->{$tfile} = 
+            $self->_get_failed_struct(
+                test_struct => \%test,
+                estatus => $estatus,
+                wstatus => $wstatus,
+                filename => $tfile,
+                results => \%results,
+            );
     }
 
     $self->_recheck_dir_files();