Add tests for a fake regex object ( bless {}, 'Regexp' )
Dave Rolsky [Fri, 15 Apr 2011 16:11:07 +0000 (11:11 -0500)]
t/type_constraints/util_std_type_constraints.t

index f1ea003..0aaf02c 100644 (file)
@@ -38,6 +38,7 @@ my $FH_OBJECT = IO::File->new( $0, 'r' )
 
 my $REGEX      = qr/../;
 my $REGEX_OBJ  = bless qr/../, 'BlessedQR';
+my $FAKE_REGEX = bless {}, 'Regexp';
 
 my $OBJECT = bless {}, 'Foo';
 
@@ -85,6 +86,7 @@ my %tests = (
             $FH_OBJECT,
             $REGEX,
             $REGEX_OBJ,
+            $FAKE_REGEX,
             $OBJECT,
             $UNDEF,
         ],
@@ -113,6 +115,7 @@ my %tests = (
             $FH_OBJECT,
             $REGEX,
             $REGEX_OBJ,
+            $FAKE_REGEX,
             $OBJECT,
             $UNDEF,
         ],
@@ -141,6 +144,7 @@ my %tests = (
             $FH_OBJECT,
             $REGEX,
             $REGEX_OBJ,
+            $FAKE_REGEX,
             $OBJECT,
         ],
         reject => [
@@ -174,6 +178,7 @@ my %tests = (
             $FH_OBJECT,
             $REGEX,
             $REGEX_OBJ,
+            $FAKE_REGEX,
             $OBJECT,
         ],
     },
@@ -204,6 +209,7 @@ my %tests = (
             $FH_OBJECT,
             $REGEX,
             $REGEX_OBJ,
+            $FAKE_REGEX,
             $OBJECT,
         ],
     },
@@ -231,6 +237,7 @@ my %tests = (
             $FH_OBJECT,
             $REGEX,
             $REGEX_OBJ,
+            $FAKE_REGEX,
             $OBJECT,
             $UNDEF,
         ],
@@ -261,6 +268,7 @@ my %tests = (
             $FH_OBJECT,
             $REGEX,
             $REGEX_OBJ,
+            $FAKE_REGEX,
             $OBJECT,
             $UNDEF,
         ],
@@ -277,6 +285,7 @@ my %tests = (
             $FH_OBJECT,
             $REGEX,
             $REGEX_OBJ,
+            $FAKE_REGEX,
             $OBJECT,
         ],
         reject => [
@@ -321,6 +330,7 @@ my %tests = (
             $FH_OBJECT,
             $REGEX,
             $REGEX_OBJ,
+            $FAKE_REGEX,
             $OBJECT,
             $UNDEF,
         ],
@@ -351,6 +361,7 @@ my %tests = (
             $FH_OBJECT,
             $REGEX,
             $REGEX_OBJ,
+            $FAKE_REGEX,
             $OBJECT,
             $UNDEF,
         ],
@@ -381,6 +392,7 @@ my %tests = (
             $FH_OBJECT,
             $REGEX,
             $REGEX_OBJ,
+            $FAKE_REGEX,
             $OBJECT,
             $UNDEF,
         ],
@@ -411,6 +423,7 @@ my %tests = (
             $FH_OBJECT,
             $REGEX,
             $REGEX_OBJ,
+            $FAKE_REGEX,
             $OBJECT,
             $UNDEF,
         ],
@@ -441,6 +454,7 @@ my %tests = (
             $FH_OBJECT,
             $REGEX,
             $REGEX_OBJ,
+            $FAKE_REGEX,
             $OBJECT,
             $UNDEF,
         ],
@@ -471,6 +485,7 @@ my %tests = (
             $FH_OBJECT,
             $REGEX,
             $REGEX_OBJ,
+            $FAKE_REGEX,
             $OBJECT,
             $UNDEF,
         ],
@@ -501,6 +516,7 @@ my %tests = (
             $FH_OBJECT,
             $REGEX,
             $REGEX_OBJ,
+            $FAKE_REGEX,
             $OBJECT,
             $UNDEF,
         ],
@@ -533,6 +549,7 @@ my %tests = (
             $FH_OBJECT,
             $OBJECT,
             $UNDEF,
+            $FAKE_REGEX,
         ],
     },
     GlobRef => {
@@ -562,6 +579,7 @@ my %tests = (
             $OBJECT,
             $REGEX,
             $REGEX_OBJ,
+            $FAKE_REGEX,
             $UNDEF,
         ],
     },
@@ -592,6 +610,7 @@ my %tests = (
             $OBJECT,
             $REGEX,
             $REGEX_OBJ,
+            $FAKE_REGEX,
             $UNDEF,
         ],
     },
@@ -600,6 +619,7 @@ my %tests = (
             $FH_OBJECT,
             $REGEX,
             $REGEX_OBJ,
+            $FAKE_REGEX,
             $OBJECT,
         ],
         reject => [
@@ -653,6 +673,7 @@ my %tests = (
             $FH_OBJECT,
             $REGEX,
             $REGEX_OBJ,
+            $FAKE_REGEX,
             $OBJECT,
             $UNDEF,
         ],
@@ -685,6 +706,7 @@ my %tests = (
             $FH_OBJECT,
             $REGEX,
             $REGEX_OBJ,
+            $FAKE_REGEX,
             $OBJECT,
             $UNDEF,
         ],
@@ -773,6 +795,7 @@ for my $name ( sort keys %tests ) {
                 $FH_OBJECT,
                 $REGEX,
                 $REGEX_OBJ,
+                $FAKE_REGEX,
                 $OBJECT,
                 $UNDEF,
             ],
@@ -833,6 +856,7 @@ for my $name ( sort keys %tests ) {
                 $FH_OBJECT,
                 $REGEX,
                 $REGEX_OBJ,
+                $FAKE_REGEX,
                 $OBJECT,
                 ( bless {}, 'Bird' ),
                 $UNDEF,
@@ -871,6 +895,7 @@ for my $name ( sort keys %tests ) {
                 $FH_OBJECT,
                 $REGEX,
                 $REGEX_OBJ,
+                $FAKE_REGEX,
                 $OBJECT,
                 $UNDEF,
             ],
@@ -896,6 +921,7 @@ for my $name ( sort keys %tests ) {
                 $FH_OBJECT,
                 $REGEX,
                 $REGEX_OBJ,
+                $FAKE_REGEX,
                 $OBJECT,
             ],
             reject => [