From 36646aa2c4760b206b6f5b038ab94d33adc665cf Mon Sep 17 00:00:00 2001 From: Eugene Wissner Date: Sat, 28 Apr 2018 18:07:41 +0200 Subject: [PATCH] container.Set: Rewrite arch dependent tests --- source/tanya/container/set.d | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/source/tanya/container/set.d b/source/tanya/container/set.d index 39cdcda..772e9b4 100644 --- a/source/tanya/container/set.d +++ b/source/tanya/container/set.d @@ -580,36 +580,28 @@ if (is(typeof(hasher(T.init)) == size_t)) Set!int set; assert(set.insert(5) == 1); - assert(set.data[0].status == BucketStatus.empty); - assert(set.data[1].key == 5 && set.data[1].status == BucketStatus.used); - assert(set.data[2].status == BucketStatus.empty); + assert(5 in set); assert(set.data.length == 3); assert(set.insert(5) == 0); - assert(set.data[0].status == BucketStatus.empty); - assert(set.data[1].key == 5 && set.data[1].status == BucketStatus.used); - assert(set.data[2].status == BucketStatus.empty); + assert(5 in set); assert(set.data.length == 3); assert(set.insert(9) == 1); - assert(set.data[0].key == 9 && set.data[0].status == BucketStatus.used); - assert(set.data[1].key == 5 && set.data[1].status == BucketStatus.used); - assert(set.data[2].status == BucketStatus.empty); + assert(9 in set); + assert(5 in set); assert(set.data.length == 3); assert(set.insert(7) == 1); assert(set.insert(8) == 1); - assert(set.data[0].status == BucketStatus.empty); - assert(set.data[1].key == 8); - assert(set.data[2].key == 5); - assert(set.data[3].status == BucketStatus.empty); - assert(set.data[4].key == 9); - assert(set.data[5].key == 7); + assert(8 in set); + assert(5 in set); + assert(9 in set); + assert(7 in set); assert(set.data.length == 7); assert(set.insert(16) == 1); - assert(set.data[5].key == 7); - assert(set.data[6].key == 16); + assert(16 in set); assert(set.data.length == 7); }