governance: keep repository root clean; remove marker file; implement repo detection via structure heuristic; update tests and system prompts/templates
This commit is contained in:
33
tests/01_new_mode.sh
Normal file
33
tests/01_new_mode.sh
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
mode="DemoMode"
|
||||
dir="modes/$mode"
|
||||
|
||||
# Clean up from prior runs
|
||||
rm -rf "$dir"
|
||||
|
||||
# Create new mode
|
||||
if ! bash ./CodexHelper new-mode --name "$mode" >nm.out 2>nm.err; then
|
||||
echo "new-mode failed unexpectedly" >&2; exit 1
|
||||
fi
|
||||
|
||||
[ -f "$dir/mode.md" ] || { echo "missing $dir/mode.md" >&2; exit 1; }
|
||||
[ -f "$dir/defaults.yaml" ] || { echo "missing $dir/defaults.yaml" >&2; exit 1; }
|
||||
|
||||
# Running again without --force should fail
|
||||
if bash ./CodexHelper new-mode --name "$mode" >nm2.out 2>nm2.err; then
|
||||
echo "new-mode should have failed on overwrite without --force" >&2; exit 1
|
||||
fi
|
||||
grep -qi "already exists" nm2.err || { echo "missing overwrite message" >&2; exit 1; }
|
||||
|
||||
# With --force should succeed
|
||||
if ! bash ./CodexHelper new-mode --name "$mode" --force >nm3.out 2>nm3.err; then
|
||||
echo "new-mode --force failed unexpectedly" >&2; exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
Reference in New Issue
Block a user