std.testing¶
Accepted
Accepted for V1 namespace ownership and the minimal assert helper.
std.testing owns test assertions and standard test-support APIs.
Expected Contents¶
- assertions
- equality/assertion helpers once equality and formatting policy is settled
- test fixtures and scoped test helpers
- testing-specific allocator wrappers when they are test-harness policy rather than general allocator policy
V1 accepts one minimal assertion helper:
pub fn assert(condition: bool, message: ?[]const u8 = null) void
std.testing.assert(condition) and std.testing.assert(condition, "message") are calls to this same declaration through the default-parameter rule.
Assertions are universal enough to deserve a standard spelling, but not a keyword or automatic prelude name. Their build-mode behavior, diagnostics, and test integration are standard-library policy.
If condition is true, assert returns void. If condition is false, it triggers a deterministic test/assertion trap outside ordinary T!E error returns. The optional message is a byte slice; V1 assertion reporting does not depend on std.fmt, allocation, or IO.
V1 Boundary¶
Equality assertions, expected diagnostics, fixtures, test-runner integration, failed-value formatting, and broader testing policy are deferred to CEP-0054: Standard Utility APIs.
Testing allocators that report leaks are future standard-library work tracked by CEP-0059: Testing Allocator and Leak Reporting.