This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Replace three uses of eval_ok() with is() as the tested code doesn't die.
authorNicholas Clark <nick@ccl4.org>
Sat, 5 Mar 2011 13:48:43 +0000 (13:48 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 5 Mar 2011 20:26:11 +0000 (20:26 +0000)
It's not clear whether the code ever threw exceptions. Not using eval_ok() here
makes subsequent refactoring a lot simpler.

t/re/pat_rt_report.t

index 923b649..4ecd3cc 100644 (file)
@@ -528,12 +528,12 @@ sub run_tests {
             sub gloople {"!"}
         }
         my $aeek = bless {} => 'wooosh';
-        eval_ok sub {$aeek -> gloople () =~ /(.)/g},
-               "//g match against return value of sub [change e26a497577f3ce7b]";
+        is(do {$aeek -> gloople () =~ /(.)/g}, 1,
+          "//g match against return value of sub [change e26a497577f3ce7b]");
 
         sub gloople {"!"}
-        eval_ok sub {gloople () =~ /(.)/g},
-               "change e26a497577f3ce7b didn't affect sub calls for some reason";
+        is(do{gloople () =~ /(.)/g}, 1,
+          "change e26a497577f3ce7b didn't affect sub calls for some reason");
     }
 
     {
@@ -583,8 +583,8 @@ sub run_tests {
         no warnings 'utf8';
         $_ = pack 'U0C2', 0xa2, 0xf8;  # Ill-formed UTF-8
         my $ret = 0;
-        eval_ok sub {!($ret = s/[\0]+//g)},
-                "Ill-formed UTF-8 doesn't match NUL in class; Bug 37836";
+        is(do {!($ret = s/[\0]+//g)}, 1,
+          "Ill-formed UTF-8 doesn't match NUL in class; Bug 37836");
     }
 
     {