test: add profile-logic and installer test suite
bash tests/test_profiles.sh (or: make test) Covers the bug classes that surfaced during recent work, without any external dependencies or network: Profile logic (stub `claude` captures exported ANTHROPIC_* env): - pro profile clears stale ANTHROPIC env and launches claude - glm/free profiles export BASE_URL/AUTH_TOKEN/MODEL correctly - error paths: missing OPENROUTER_API_KEY, unknown profile, bad mode each exit 1 Installer symlink logic (isolated temp HOME, throwaway clone): - S1 broken/dangling symlink -> repointed via ln -sfn (was fatal before) - S2 real directory at target -> warning, preserved (was silent) - S3 free path -> new symlink created - S4 existing symlink -> repointed All tests use temp dirs for HOME and a throwaway repo clone, so the real working tree is never touched. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
55d9e52b43
commit
44a9a02a94
2 changed files with 225 additions and 0 deletions
3
Makefile
Normal file
3
Makefile
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
.PHONY: test
|
||||
test:
|
||||
@bash tests/test_profiles.sh
|
||||
Loading…
Add table
Add a link
Reference in a new issue