gabriel / muse-zsh public
test minor task/comprehensive-test-suite #1 / 1
gabriel · 56 days ago · Apr 13, 2026 · Diff

test: comprehensive test suite — unit, integration, e2e, stress, security, data integrity, performance

8 new bats test files covering 100% of the muse-zsh codebase:

tests/test_prompt.bats (44 tests) Unit tests for muse_prompt_info, muse_workspace_info, muse_prompt_ahead_behind, muse_debug, aliases, config defaults.

tests/test_integration.bats (26 tests) Hook lifecycle (_muse_hook_chpwd/preexec/precmd), _muse_refresh / _muse_refresh_full pipeline, full refresh→prompt pipeline with a mock muse status binary.

tests/test_completions.bats (34 tests) _muse_dot_muse, _muse_branches, _muse_remotes helper functions; zsh -n syntax check; _muse function registration; 20+ content checks confirming every major command and flag is in the file.

tests/test_install.bats (17 tests) install.sh error conditions, directory creation, symlink creation and resolution, idempotence, and output content.

tests/test_security.bats (21 tests) Branch/domain/workspace %-escaping, injection rejection via validation regex ($(cmd), backtick, semicolon, pipe, ANSI), no-eval invariant, HEAD file integrity, JSON field name safety.

tests/test_stress.bats (18 tests) Branch name at 200 chars, 10-level slash hierarchy, single char; _muse_find_root at 30 directories deep; 50 branches in refs/heads/; large repo.json (5 KB); 100 rapid repeated parse calls; _muse_json_int boundary values.

tests/test_data_integrity.bats (25 tests) HEAD format variations (CRLF, tag refs, remote refs, short SHA); repo.json domain edge cases (32/33 char, Unicode, array/number types, duplicates); _muse_json_int for negatives/floats/booleans; muse_branch_info 8-field invariant.

tests/test_performance.bats (15 tests) Zero-subprocess invariant for 9 pure functions via spy muse binary; _muse_check_dirty DOES call muse; timeout returns RC=124 and preserves stale state; plugin sources in <5s; 1000-call throughput benchmarks for prompt_info, branch_info, parse_head.

sha256:cd997e172ef9a90cef4cf55ca15522c89f340590e049976956a0a1d523c9a556 sha
sha256:79bbef48357523cfe54c29d1265cf0f456aa0009401f66410822e6336bc1060a snapshot
← Older Oldest on task/comprehensive-test-suite
All commits
Newer → Latest on task/comprehensive-test-suite

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:cd997e172ef9a90cef4cf55ca15522c89f340590e049976956a0a1d523c9a556 --body "your comment"