From ef3b04503a82e4d4b065faa2e61bc26f0cd9ebf2 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Tue, 27 Aug 2024 15:06:52 -0700 Subject: [PATCH] test: augment collections test to exercise clear/has/re-init This was broken because of #8756 . The modified tests are marked as failing, until the fix is landed. --- .../test/collections.test.js | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/swingset-liveslots/test/collections.test.js b/packages/swingset-liveslots/test/collections.test.js index 9a70d129b956..9bebc238920e 100644 --- a/packages/swingset-liveslots/test/collections.test.js +++ b/packages/swingset-liveslots/test/collections.test.js @@ -145,6 +145,14 @@ function exerciseMapOperations(t, collectionName, testStore) { `key "[Alleged: something missing]" not found in collection "${collectionName}"`, ), ); + if (collectionName === 'map') { + // strong map, so we can .clear + testStore.clear(); + for (const [key, _value] of stuff) { + t.false(testStore.has(key)); + } + fillBasicMapStore(testStore); + } } function exerciseSetOperations(t, collectionName, testStore) { @@ -172,9 +180,17 @@ function exerciseSetOperations(t, collectionName, testStore) { `key "[Alleged: something missing]" not found in collection "${collectionName}"`, ), ); + if (collectionName === 'set') { + // strong set, so we can .clear + testStore.clear(); + for (const [key, _value] of stuff) { + t.false(testStore.has(key)); + } + fillBasicSetStore(testStore); + } } -test('basic map operations', t => { +test.failing('basic map operations', t => { exerciseMapOperations( t, 'map', @@ -190,7 +206,7 @@ test('basic weak map operations', t => { ); }); -test('basic set operations', t => { +test.failing('basic set operations', t => { exerciseSetOperations( t, 'set',