ref: 3302303980ad9c02da032c04447af3a0cc1fc133 zig-bare/src/test.zig -rw-r--r-- 22.8 KiB
Handle reading of invalid enum values
Use reader/writer instead of inStream/outStream
Port everything so `zig build test` works on 0.7.0

The earlier commit got what I was using working on 0.7.0, but I forgot
to run the test suite to ensure everything was updated. Now I have run
it and all of the tests work.

- The varint tests were failing because the `readVarInt` functions are
  private. I moved these tests to `src/bare.zig` because I figure these
  are internal details that shouldn't be made public.
Add test for duplicate enum values
Better compile error messages
Test non-slice pointers
Tests for bare unions
Test compile errors
zig fmt
Clean up `void` handling

As it's only supported in tagged unions, might as well special-case it there.
Test tagged union with active void member
Handle maps with 0 items
Test `map[u8]void`
Simplify and fix a bug in `readHashMap`
Be more picky about map keys
Provide a `deinit` function on `Reader`
Turn errors into @compileError("where possible")
Improved pointer/slice writing
Enforce/test BARE hashmap key type invariant
Enforce/test BARE struct field count invariant
Enforce/test BARE array length invariant