develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r35796 - trunk/languages/perl6

From:
jonathan
Date:
January 20, 2009 03:46
Subject:
[svn:parrot] r35796 - trunk/languages/perl6
Message ID:
20090120114529.1A8E2CB9AE@x12.develooper.com
Author: jonathan
Date: Tue Jan 20 03:45:28 2009
New Revision: 35796

Modified:
   trunk/languages/perl6/Test.pm

Log:
[rakudo] Seems Test.pm was patched with extra features, but unfortunately that causes it to break on a few tests. This patch tweaks the workaround for some things not having a .perl method, which gets us passing pretty much everything again, aside from fail.t, which I'm really not sure what is wrong with yet...

Modified: trunk/languages/perl6/Test.pm
==============================================================================
--- trunk/languages/perl6/Test.pm	(original)
+++ trunk/languages/perl6/Test.pm	Tue Jan 20 03:45:28 2009
@@ -179,11 +179,10 @@
 ## 'private' subs
 
 sub diag_bool_true($passed) {
-    # Workaround for: Method 'perl' not found for invocant of class 'Match'
-    # and issues with the Exception&Iterator class might work, but I don't grok it.
-    my $have = $passed.WHAT eq any(<Match Exception Iterator>)
-        ?? $passed
-        !! $passed.perl;
+    # Workaround for: Method 'perl' not found for invocant (various classes,
+    # including some anonymous, so can't just make a list).
+    my $have;
+    try { $have = $passed.perl; CATCH { $have = $passed } }
     return $passed
         ?? ''
         !! "# Expected a true value.\n# have: {$have}";
@@ -196,11 +195,10 @@
 }
 
 sub diag_eq($passed, $have, $want) {
-    # Workaround for: Method 'perl' not found for invocant of class 'Match'
-    # and issues with the Exception&Iterator class might work, but I don't grok it.
-    my $x_have = $passed.WHAT eq any(<Match Exception Iterator>)
-        ?? $passed
-        !! $passed.perl;
+    # Workaround for: Method 'perl' not found for invocant (various classes,
+    # including some anonymous, so can't just make a list).
+    my $x_have;
+    try { $x_have = $passed.perl; CATCH { $x_have = $passed } }
     return $passed ?? '' !! "# have: {$x_have}\n# want: {$want.perl}";
 }
 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About