starting on the error messaging problem;
[gitmo/MooseX-Dependent.git] / t / 02-depending.t
index df57670..dbffb72 100644 (file)
@@ -42,7 +42,8 @@ use Test::More tests=>24; {
        ok IntGreaterThanInt->check([12,1]), "Success, 12 is greater than1.";
        ok IntGreaterThanInt->check([0,-10]), "Success, 0 is greater than -10.";
     
-    ## The dependent value cannot exist in the constraining arrayref
+    ## The dependent value cannot exist in the constraining arrayref.  Also, it
+       ## (the dependent type) must exceed 2.
     subtype UniqueInt,
       as Depending[
         Int,
@@ -66,7 +67,7 @@ use Test::More tests=>24; {
     ok UniqueInt->check([3,[100..110]]), 'PASS unique in set';
     ok UniqueInt->check([4,[100..110]]), 'PASS unique in set'; 
        
-       ## Basically as above, with sugar
+       ## Basically as above, with sugar.
     subtype UniqueInt2,
          as depending {
             my ($dependent_int, $constraining_arrayref) = @_;
@@ -84,5 +85,9 @@ use Test::More tests=>24; {
     ok !UniqueInt2->check([10,[1,10,15]]), 'not unique in set';
     ok !UniqueInt2->check([2,[3..6]]), 'FAIL dependent is too small';
     ok UniqueInt2->check([3,[100..110]]), 'PASS unique in set';
-    ok UniqueInt2->check([4,[100..110]]), 'PASS unique in set';        
+    ok UniqueInt2->check([4,[100..110]]), 'PASS unique in set';
+
+       ## Basic error messages.  TODO should be it's own test
+       
+       warn UniqueInt2->validate(['a',[1,2,3]]);
 }