[svn:parrot] r45987 - in trunk/runtime/parrot/library/Test: . Builder

fperrad at svn.parrot.org fperrad at svn.parrot.org
Sat Apr 24 15:50:25 UTC 2010


Author: fperrad
Date: Sat Apr 24 15:50:25 2010
New Revision: 45987
URL: https://trac.parrot.org/parrot/changeset/45987

Log:
[Test/More] diag() with multi arguments

Modified:
   trunk/runtime/parrot/library/Test/Builder.pir
   trunk/runtime/parrot/library/Test/Builder/Output.pir
   trunk/runtime/parrot/library/Test/More.pir

Modified: trunk/runtime/parrot/library/Test/Builder.pir
==============================================================================
--- trunk/runtime/parrot/library/Test/Builder.pir	Sat Apr 24 15:13:54 2010	(r45986)
+++ trunk/runtime/parrot/library/Test/Builder.pir	Sat Apr 24 15:50:25 2010	(r45987)
@@ -312,22 +312,18 @@
     .return()
 .end
 
-=item C<diag( diagnostic_message )>
+=item C<diag( diagnostic_message, ... )>
 
 Records a diagnostic message for output.
 
 =cut
 
 .sub 'diag' :method
-    .param string diagnostic
+    .param pmc args :slurpy
 
-    if diagnostic goto DIAGNOSTIC_SET
-    .return()
-
-  DIAGNOSTIC_SET:
     .local pmc output
     output = self.'output'()
-    output.'diag'( diagnostic )
+    .tailcall output.'diag'( args :flat )
 .end
 
 =item C<ok( passed, description )>

Modified: trunk/runtime/parrot/library/Test/Builder/Output.pir
==============================================================================
--- trunk/runtime/parrot/library/Test/Builder/Output.pir	Sat Apr 24 15:13:54 2010	(r45986)
+++ trunk/runtime/parrot/library/Test/Builder/Output.pir	Sat Apr 24 15:50:25 2010	(r45987)
@@ -161,7 +161,7 @@
 	.return( message )
 .end
 
-=item C<diag( message )>
+=item C<diag( message, ... )>
 
 Writes the string C<message> to the diagnostic filehandle, TAP-escaping any
 unescaped newlines.
@@ -169,7 +169,9 @@
 =cut
 
 .sub diag :method
-	.param string message
+	.param pmc args :slurpy
+	.local string message
+	message = join '', args
 
 	.local int message_length
 	message_length = length message
@@ -190,7 +192,7 @@
   WRITE_MESSAGE:
 	.local pmc diag_output
 	diag_output = self.'diag_output'()
-	diag_output.'puts'( message )
+	.tailcall diag_output.'puts'( message )
 .end
 
 =back

Modified: trunk/runtime/parrot/library/Test/More.pir
==============================================================================
--- trunk/runtime/parrot/library/Test/More.pir	Sat Apr 24 15:13:54 2010	(r45986)
+++ trunk/runtime/parrot/library/Test/More.pir	Sat Apr 24 15:50:25 2010	(r45987)
@@ -527,18 +527,18 @@
   done:
 .end
 
-=item C<diag( diagnostic )>
+=item C<diag( diagnostic, ... )>
 
 Prints C<diagnostic> to the screen, without affecting test comparisons.
 
 =cut
 
 .sub diag
-    .param string diagnostic
+    .param pmc args :slurpy
 
     .local pmc test
     get_hll_global test, [ 'Test'; 'More' ], '_test'
-    test.'diag'( diagnostic )
+    .tailcall test.'diag'( args :flat )
 .end
 
 


More information about the parrot-commits mailing list