Files
wren/test
Robert Nystrom 5f0d1f909b fix: replace hashBits with V8's integer hash to fix catastrophic collision for numeric keys
The old hashBits function XORed the two 32-bit halves of a double and applied
Java HashMap-style mixing, but for small integers the low bits of the double
representation are mostly zero, causing nearly all keys to map to entry zero.
This replaces it with Thomas Wang's integer hash (as used by V8's
ComputeLongHash), which properly scatters bits across the 32-bit key space.
Also updates the map_numeric benchmark to iterate 2,000,000 entries (up from
1,000,000) and adjusts the expected output in util/benchmark.py accordingly.
2019-07-27 20:34:07 +00:00
..

This contains the automated validation suite for the VM and built-in libraries.

  • benchmark/ - Performance tests. These aren't strictly pass/fail, but let us compare performance both against other languages and against previous builds of Wren itself.

  • core/ - Tests for the built in core library, mainly methods on the core classes. If a bug is in wren_core.c or wren_value.c, it will most likely break one of these tests.

  • language/ - Tests of the language itself, its grammar and runtime semantics. If a bug is in wren_compiler.c or wren_vm.c, it will most likely break one of these tests. This includes tests for the syntax for the literal forms of the core classes.

  • limit/ - Tests for various hardcoded limits. The language doesn't officially specify these limits, but the Wren implementation has them. These tests ensure that limit behavior is well-defined and tested.