Skip to content

Commit e61310a

Browse files
committed
Fix AA iteration order dependency in testaa2.d
1 parent feb042c commit e61310a

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

test/runnable/testaa2.d

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ foo()
66
foo() 2
77
foo() 3
88
foo() 4
9-
c["foo"] = 3
10-
c["bar"] = 4
119
Success
1210
---
1311
*/
@@ -62,10 +60,9 @@ void foo2()
6260
value = c.values;
6361
assert(value.length == 2);
6462

65-
for (i = 0; i < key.length; i++)
66-
{
67-
printf("c[\"%.*s\"] = %d\n", cast(int)key[i].length, key[i].ptr, value[i]);
68-
}
63+
const fooIndex = key[1] == "foo";
64+
assert(key[fooIndex] == "foo" && value[fooIndex] == 3);
65+
assert(key[1 - fooIndex] == "bar" && value[1 - fooIndex] == 4);
6966

7067
assert("foo" in c);
7168
c.remove("foo");

0 commit comments

Comments
 (0)