Files
nixpkgs/tests/lib/agents-test.nix
m3ta-chiron 14d7dc47a5 chore: update .gitignore, remove tracked .pi-lens files, and sync pending changes
- Add .cache to .gitignore
- Remove .pi-lens/ from git tracking (already ignored)
- Update pi-agent-runner, pi-agent-wrapper modules
- Update claude-code agent module
- Update overlays, opencode-desktop package, and tests
2026-04-17 11:07:08 +02:00

27 lines
769 B
Nix

let
lib = import <nixpkgs/lib>;
agentsLib = (import ../../lib {inherit lib;}).agents;
# Test 1: renderForTool throws for unknown tools
testUnknownTool = let
result = builtins.tryEval (
agentsLib.renderForTool {
pkgs = {};
agentsInput = {};
tool = "unknown-tool";
}
);
in
assert result.success == false; {result = "pass";};
# Test 2: loadCanonical extracts loadAgents from input
testLoadCanonical = let
fakeInput = {lib.loadAgents = {test = {description = "test";};};};
result = agentsLib.loadCanonical {agentsInput = fakeInput;};
in
assert result == {test = {description = "test";};}; {result = "pass";};
in {
unknown-tool-throws = testUnknownTool;
load-canonical = testLoadCanonical;
}