diff Lib/IMPL/Test.pm @ 3:2e546a5175dd

in developing
author Sergey
date Tue, 11 Aug 2009 17:45:52 +0400
parents 03e58a454b20
children 16ada169ca75
line wrap: on
line diff
--- a/Lib/IMPL/Test.pm	Mon Aug 10 17:39:08 2009 +0400
+++ b/Lib/IMPL/Test.pm	Tue Aug 11 17:45:52 2009 +0400
@@ -4,7 +4,7 @@
 
 require Exporter;
 our @ISA = qw(Exporter);
-our @EXPORT_OK = qw(&test &shared);
+our @EXPORT_OK = qw(&test &shared &failed &cmparray);
 
 require IMPL::Test::Unit;
 use IMPL::Class::Member;
@@ -29,4 +29,20 @@
     
     $class->set_meta(new IMPL::Test::Unit::SharedData($propInfo->Name));
 }
+
+sub failed($;@) {
+    die new IMPL::Test::FailException(@_);
+}
+
+sub cmparray {
+    my ($a,$b) = @_;
+    
+    return 0 unless @$a == @$b;
+    
+    for (my $i=0; $i < @$a; $i++ ) {
+        return 0 unless $a->[$i] eq $b->[$i];
+    }
+    
+    return 1;
+}
 1;