[svn:parrot] r39617 - branches/tt761_keys_revamp/t/pmc
bacek at svn.parrot.org
bacek at svn.parrot.org
Wed Jun 17 11:46:00 UTC 2009
Author: bacek
Date: Wed Jun 17 11:45:59 2009
New Revision: 39617
URL: https://trac.parrot.org/parrot/changeset/39617
Log:
[t] Don't rely on keys order in Hash iterator test.
Modified:
branches/tt761_keys_revamp/t/pmc/hash.t
Modified: branches/tt761_keys_revamp/t/pmc/hash.t
==============================================================================
--- branches/tt761_keys_revamp/t/pmc/hash.t Wed Jun 17 10:22:23 2009 (r39616)
+++ branches/tt761_keys_revamp/t/pmc/hash.t Wed Jun 17 11:45:59 2009 (r39617)
@@ -1204,22 +1204,27 @@
iter = new ['Iterator'], thash
iter = .ITERATE_FROM_START
- .local string key
+ .local pmc keys, key
+ keys = new ['ResizablePMCArray']
# go through the hash, print out all the keys: should be a c and e
preit_loop:
unless iter goto preit_end
key = shift iter
- result .= key
+ $S0 = key
+ push keys, $S0
branch preit_loop
preit_end:
+ keys.'sort'()
+ result = join '', keys
is( result, 'ace', 'iterated through keys successfully' )
# get rid of the c element?
delete thash["c"]
+ keys = new ['ResizablePMCArray']
# what do we have after deletion?
result = ""
@@ -1233,11 +1238,15 @@
unless iter goto postit_end
key = shift iter
- result .= key
+ $S0 = key
+ push keys, $S0
+
branch postit_loop
postit_end:
+ keys.'sort'()
+ result = join '', keys
is( result, 'ae', 'the c key was no longer iterated over' )
.end
More information about the parrot-commits
mailing list