Skip to content

Commit

Permalink
test: augment collections test to exercise clear/has/re-init
Browse files Browse the repository at this point in the history
this was broken because of #8756
  • Loading branch information
warner committed Aug 27, 2024
1 parent ca2d469 commit 4cb2452
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/swingset-liveslots/test/collections.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -172,6 +180,14 @@ 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 => {
Expand Down

0 comments on commit 4cb2452

Please sign in to comment.