[svn:parrot] r41093 - trunk/t/library

dukeleto at svn.parrot.org dukeleto at svn.parrot.org
Mon Sep 7 05:08:04 UTC 2009


Author: dukeleto
Date: Mon Sep  7 05:08:01 2009
New Revision: 41093
URL: https://trac.parrot.org/parrot/changeset/41093

Log:
[t] Fix tests for like() which passed for the wrong reason

Modified:
   trunk/t/library/test_more.t

Modified: trunk/t/library/test_more.t
==============================================================================
--- trunk/t/library/test_more.t	Mon Sep  7 04:52:48 2009	(r41092)
+++ trunk/t/library/test_more.t	Mon Sep  7 05:08:01 2009	(r41093)
@@ -41,34 +41,35 @@
 .sub test_throws_like
 
     test_fail('throws_like fails when there is no error')
-
     throws_like( <<'CODE', 'somejunk', 'throws_like fails when there is no error')
 .sub main
     $I0 = 42
 .end
 CODE
-
     test_diag( 'no error thrown' )
     test_test( 'throws_like fails when there is no error')
-    test_pass('throws_like passes when error matches pattern')
 
-    throws_like( <<'CODE', '<[for the lulz]>','throws_like passes when error matches pattern')
+    test_pass('throws_like passes when error matches pattern')
+    throws_like( <<'CODE', 'for\ the\ lulz','throws_like passes when error matches pattern')
 .sub main
     die 'I did it for the lulz'
 .end
 CODE
-
     test_test( 'throws_like passes when error matches pattern' )
 
     test_fail( 'throws_like fails when error does not match pattern' )
-
-    throws_like( <<'CODE', '<[for the lulz]>','throws_like fails when error does not match pattern')
+    throws_like( <<'CODE', 'for\ the\ lulz','throws_like fails when error does not match pattern')
 .sub main
     die 'DO NOT WANT'
 .end
 CODE
-    test_diag( "match failed: target 'DO NOT WANT' does not match pattern '<[for the lulz]>'" )
+    .local string diagnostic
+    diagnostic  = "match failed: target 'DO NOT WANT' does not match pattern '"
+    diagnostic .= 'for\ the\ lulz'
+    diagnostic .= "'"
+    test_diag( diagnostic )
     test_test('throws_like fails when error does not match pattern' )
+
 .end
 
 .sub test_ok


More information about the parrot-commits mailing list