diff Lib/IMPL/Test/BadUnit.pm @ 31:d59526f6310e

Small fixes to Test framework (correct handlinf of the compilation errors in the test units) Imported and refactored SQL DB schema from the old project
author Sergey
date Mon, 09 Nov 2009 01:39:16 +0300
parents 03e58a454b20
children 16ada169ca75
line wrap: on
line diff
--- a/Lib/IMPL/Test/BadUnit.pm	Tue Nov 03 16:31:47 2009 +0300
+++ b/Lib/IMPL/Test/BadUnit.pm	Mon Nov 09 01:39:16 2009 +0300
@@ -13,12 +13,18 @@
 
 our %CTOR = (
     'IMPL::Test::Unit' => sub {
-        my ($unit,$message,$error) = @_;
-        return new IMPL::Test::Unit::TestInfo(
-            BadUnitTest => sub {
-                die new IMPL::Test::FailException($message,$unit,eval {$error->isa('IMPL::Exception')} ? $error->toString(1) : $error)
-            }
-        );
+        if (@_>1) {
+            # Unit construction
+            my ($unit,$message,$error) = @_;
+            return new IMPL::Test::Unit::TestInfo(
+                BadUnitTest => sub {
+                    die new IMPL::Test::FailException($message,$unit,eval {$error->isa('IMPL::Exception')} ? $error->toString(1) : $error)
+                }
+            );
+        } else {
+            # test construction
+            return @_;
+        }
     }
 );
 
@@ -45,5 +51,15 @@
     $inst->callCTOR(@args{qw(UnitName Message)});
 }
 
+sub List {
+    my ($this) = @_;
+    my $error = $this->Error;
+    return new IMPL::Test::Unit::TestInfo(
+        BadUnitTest => sub {
+            die new IMPL::Test::FailException($this->Message,$this->UnitName,eval {$error->isa('IMPL::Exception')} ? $error->toString(1) : $error)
+        }
+    );
+}
+
 
 1;