zig/test
Ryan Liptak bcb5218a2b Environ: reinstate null return on = in environment variable keys
Changes an assert back into a conditional to match the behavior of `getPosix`, see https://codeberg.org/ziglang/zig/pulls/31113#issuecomment-10371698 and https://github.com/ziglang/zig/issues/23331.
Note: the conditional has been updated to also return null early on 0-length key lookups, since there's no need to iterate the block in that case.

For `Environ.Map`, validation of keys has been split into two categories: 'put' and 'fetch', each of which are tailored to the constraints that the implementation actually relies upon. Specifically:
- Hashing (fetching) requires the keys to be valid WTF-8 on Windows, but does not rely on any other properties of the keys (attempting to fetch `F\x00=` is not a problem, it just won't be found)
- `create{Posix,Windows}Block` relies on the Map to always have fully valid keys (no NUL, no `=` in an invalid location, no zero-length keys), which means that the 'put' APIs need to validate that incoming keys adhere to those properties.
The relevant assertions are now documented on each of the Map functions.

Also reinstates some test cases in the `env_vars` standalone test. Some of the reinstated tests are effectively just testing the Environ.Map implementation due to how `Environ.contains`, `Environ.getAlloc`, etc are implemented, but that is not inherent to those functions so the tests are still potentially relevant if e.g. `contains` is implemented in terms of `getPosix`/`getWindows` in the future (which is totally possible and maybe a good idea since constructing the whole map is not necessary for looking up one key).
2026-02-05 20:24:31 +01:00
..
behavior add behavior test for i96 operations 2026-01-29 19:57:36 +01:00
c_abi test: fix up c3ee8078b4 2025-12-16 09:01:51 +01:00
cases Sema: better switch_block_err_union result location if operand has wrong type 2026-01-11 11:37:18 +00:00
cli/options test: move standalone/options/ to cli/options/ 2025-10-04 21:55:39 +02:00
incremental update all incremental tests to new std API 2025-12-23 22:15:11 -08:00
link MachO: fix dynamic lookup of undefined symbols at runtime 2026-01-21 00:31:21 +01:00
src test: improve logic for generating stack trace test combinations 2026-02-03 20:19:15 +01:00
standalone Environ: reinstate null return on = in environment variable keys 2026-02-05 20:24:31 +01:00
behavior.zig delete behavior test that depends on std.fmt 2025-08-31 12:49:18 -07:00
cases.zig test: remove ad-hoc nvptx tests 2025-10-04 20:51:07 +02:00
compile_errors.zig compiler: refactor Zcu.File and path representation 2025-05-18 17:37:02 +01:00
error_traces.zig test: disable an error trace test on optimized x86_64-netbsd 2026-01-19 13:16:11 +01:00
gen_h.zig all: zig fmt and rename "@XToY" to "@YFromX" 2023-06-19 12:34:42 -07:00
libc.zig libzigc: roundf 2026-01-31 18:18:29 -08:00
llvm_ir.zig test: Add some basic LLVM IR tests for atomics, volatile, and allowzero. 2025-05-12 17:07:50 +02:00
llvm_targets.zig test: remove some nonsensical openbsd targets from llvm_targets 2025-12-16 06:25:32 +01:00
stack_traces.zig std: back out the StackTrace byval changes 2025-10-29 06:20:50 -07:00
tests.zig test: disable hexagon-linux-musl C ABI tests for now 2026-02-04 11:11:39 +01:00