[svn:parrot] r37979 - branches/packfile_revamp/t/pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Wed Apr 8 12:25:10 UTC 2009


Author: bacek
Date: Wed Apr  8 12:25:10 2009
New Revision: 37979
URL: https://trac.parrot.org/parrot/changeset/37979

Log:
Add test (disabled ATM) for set_string/get_string unpack/pack synonyms.

Modified:
   branches/packfile_revamp/t/pmc/packfile.t

Modified: branches/packfile_revamp/t/pmc/packfile.t
==============================================================================
--- branches/packfile_revamp/t/pmc/packfile.t	Wed Apr  8 12:24:25 2009	(r37978)
+++ branches/packfile_revamp/t/pmc/packfile.t	Wed Apr  8 12:25:10 2009	(r37979)
@@ -29,6 +29,8 @@
     'test_set_integer_keyed_str'()
     'test_get_directory'()
     'test_pack'()
+    # This test will crash on many platforms. See TT#545.
+    #'test_synonyms'()
 .end
 
 
@@ -128,6 +130,30 @@
     todo($I0, 'pack produced same result twice')
 .end
 
+# Test pack/set_string unpack/get_string equivalency
+.sub 'test_synonyms'
+    .local pmc pf
+    pf = '_pbc'()
+
+    $S0 = pf
+    $S1 = pf.'pack'()
+    $I0 = cmp $S0, $S1
+    $I0 = not $I0
+    ok($I0, "pack and get_string are synonyms")
+
+    # Unpack data in two ways
+    $P0 = new ['Packfile']
+    $P0 = $S0
+    $P1 = new ['Packfile']
+    $P1.'unpack'($S0)
+
+    $S0 = $P0
+    $S1 = $P1
+    $I0 = cmp $S0, $S1
+    $I0 = not $I0
+    ok($I0, "unpack and set_string are synonyms")
+.end
+
 # Return test filename
 # Currently parrot doesn't support system independent PBCs. So, cross your
 # fingers and try different filename for binary-dependent tests...


More information about the parrot-commits mailing list