Give accurate failure diagnostics when unlike() fails.
Nicholas Clark [Fri, 6 Apr 2007 20:46:47 +0000 (20:46 +0000)]
p4raw-id: //depot/perl@30855

t/test.pl

index 5584669..37e6682 100644 (file)
--- a/t/test.pl
+++ b/t/test.pl
@@ -274,7 +274,8 @@ sub like_yn ($$$@) {
     $pass = $got !~ /$expected/ if $flip;
     unless ($pass) {
        unshift(@mess, "#      got '$got'\n",
-               "# expected /$expected/\n");
+               $flip
+               ? "# expected !~ /$expected/\n" : "# expected /$expected/\n");
     }
     local $Level = $Level + 1;
     _ok($pass, _where(), $name, @mess);