diff --git a/tests/vectors/numeric-leaves/README.md b/tests/vectors/numeric-leaves/README.md new file mode 100644 index 00000000..e7ecb070 --- /dev/null +++ b/tests/vectors/numeric-leaves/README.md @@ -0,0 +1,14 @@ +# numeric-leaves vectors + +Written only by the C# reference, `tests/GameCult.Caching.Tests/NumericLeafVectorTests.cs`, with +`CULTCACHE_WRITE_VECTORS=1`. Every other run reads these files and compares them byte for byte; a changed vector is a +reviewed commit. Other runtimes decode them and are held to the same answers. + +A document with one slot, `[value]`, whose slot is a C# `int`, `long`, `float` or `double` (leaf `int32`, `int64`, +`float32`, `float64`). + +- `reads.msgpack`: an array of `[leaf, payload, accepted, bits]`. `payload` (bin) is the one-slot record fed to the + reference; `accepted` is whether it read; `bits` (bin, 8 bytes, big-endian) is the int64 it read, or the IEEE bits of + the double it read (a float32 widened), and empty when refused. Every value is fed to every leaf. +- `writes.msgpack`: an array of `[leaf, text, bytes]`. `text` is a decimal for an integer leaf and the double's IEEE + bits in hex for a float leaf; `bytes` (bin) is the one-slot record the reference writes for that value. diff --git a/tests/vectors/numeric-leaves/mixed-record.msgpack b/tests/vectors/numeric-leaves/mixed-record.msgpack new file mode 100644 index 00000000..8077258b Binary files /dev/null and b/tests/vectors/numeric-leaves/mixed-record.msgpack differ diff --git a/tests/vectors/numeric-leaves/reads.msgpack b/tests/vectors/numeric-leaves/reads.msgpack new file mode 100644 index 00000000..45aaf7f4 Binary files /dev/null and b/tests/vectors/numeric-leaves/reads.msgpack differ diff --git a/tests/vectors/numeric-leaves/writes.msgpack b/tests/vectors/numeric-leaves/writes.msgpack new file mode 100644 index 00000000..6bb1bad8 Binary files /dev/null and b/tests/vectors/numeric-leaves/writes.msgpack differ