test(security): add tests for Sandbox interface and NoopSandbox | 测试(sandbox): 添加 Sandbox 接口测试#751
Merged
DonPrus merged 3 commits intonullclaw:mainfrom Apr 10, 2026
Merged
Conversation
Add 8 tests covering: - NoopSandbox is always available - NoopSandbox name and description - wrapCommand passes argv through unchanged (including empty argv) - Sandbox interface vtable dispatch paths - createNoopSandbox factory - SandboxBackend enum exhaustiveness Fixes: zero-test coverage gap in security/sandbox.zig.
DonPrus
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EN:
Add 8 unit tests for
src/security/sandbox.zig, closing the zero-test coverage gap in the Sandbox abstraction layer.ZH:
为
src/security/sandbox.zig添加 8 个单元测试,消除 Sandbox 抽象层的零测试覆盖空白。What changed
EN:
src/security/sandbox.zig: added 8 tests covering:NoopSandbox.isAvailable()always returns trueNoopSandbox.name()returns "none"NoopSandbox.description()is non-emptyNoopSandbox.wrapCommand()passes argv through unchangedNoopSandbox.wrapCommand()handles empty argvSandboxinterface vtable dispatch pathscreateNoopSandbox()factory returns a functional sandboxSandboxBackendenum exhaustivenessZH:
src/security/sandbox.zig:新增 8 个测试覆盖:NoopSandbox.isAvailable()始终返回 trueNoopSandbox.name()返回 "none"NoopSandbox.description()非空NoopSandbox.wrapCommand()将 argv 原样传递NoopSandbox.wrapCommand()处理空 argvSandbox接口 vtable 分发路径createNoopSandbox()工厂返回可用沙箱SandboxBackend枚举穷举性Validation
zig build test --summary all: 6135/6146 passed (8 new tests added)