BaseXdb / basex

BaseX Main Repository.
http://basex.org
BSD 3-Clause "New" or "Revised" License
661 stars 268 forks source link

Add WeakTokenSetTest #2204

Closed GuntherRademacher closed 1 year ago

GuntherRademacher commented 1 year ago

This is a unit test for WeakTokenSet. It creates some random strings and adds them to a WeakTokenSet. Then some (or even all) of them are removed, and it is verified that those removed have been garbage collected in the set's weak references, while the others are still present.

The test is repeated 8 times. It uses a random seed, thus there is a chance to test something different with each execution. Assertion failure messages contain the seed value, so the failure can be reproduced by installing that seed.

ChristianGruen commented 1 year ago

Just fine!