container.Set: Rewrite arch dependent tests

This commit is contained in:
Eugen Wissner 2018-04-28 18:07:41 +02:00
parent 702d1b02e0
commit 36646aa2c4

View File

@ -580,36 +580,28 @@ if (is(typeof(hasher(T.init)) == size_t))
Set!int set; Set!int set;
assert(set.insert(5) == 1); assert(set.insert(5) == 1);
assert(set.data[0].status == BucketStatus.empty); assert(5 in set);
assert(set.data[1].key == 5 && set.data[1].status == BucketStatus.used);
assert(set.data[2].status == BucketStatus.empty);
assert(set.data.length == 3); assert(set.data.length == 3);
assert(set.insert(5) == 0); assert(set.insert(5) == 0);
assert(set.data[0].status == BucketStatus.empty); assert(5 in set);
assert(set.data[1].key == 5 && set.data[1].status == BucketStatus.used);
assert(set.data[2].status == BucketStatus.empty);
assert(set.data.length == 3); assert(set.data.length == 3);
assert(set.insert(9) == 1); assert(set.insert(9) == 1);
assert(set.data[0].key == 9 && set.data[0].status == BucketStatus.used); assert(9 in set);
assert(set.data[1].key == 5 && set.data[1].status == BucketStatus.used); assert(5 in set);
assert(set.data[2].status == BucketStatus.empty);
assert(set.data.length == 3); assert(set.data.length == 3);
assert(set.insert(7) == 1); assert(set.insert(7) == 1);
assert(set.insert(8) == 1); assert(set.insert(8) == 1);
assert(set.data[0].status == BucketStatus.empty); assert(8 in set);
assert(set.data[1].key == 8); assert(5 in set);
assert(set.data[2].key == 5); assert(9 in set);
assert(set.data[3].status == BucketStatus.empty); assert(7 in set);
assert(set.data[4].key == 9);
assert(set.data[5].key == 7);
assert(set.data.length == 7); assert(set.data.length == 7);
assert(set.insert(16) == 1); assert(set.insert(16) == 1);
assert(set.data[5].key == 7); assert(16 in set);
assert(set.data[6].key == 16);
assert(set.data.length == 7); assert(set.data.length == 7);
} }