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:
24
tests/helpers/assert.sh
Normal file
24
tests/helpers/assert.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
fail() { echo "ASSERTION FAILED: $*" >&2; return 1; }
|
||||
|
||||
assert_eq() {
|
||||
local expected="$1" actual="$2"; shift 2
|
||||
if [ "$expected" != "$actual" ]; then
|
||||
fail "expected='$expected' actual='$actual' $*"
|
||||
fi
|
||||
}
|
||||
|
||||
assert_contains() {
|
||||
local haystack="$1" needle="$2"; shift 2
|
||||
if ! grep -Fq -- "$needle" <<<"$haystack"; then
|
||||
fail "did not find '$needle' in output"
|
||||
fi
|
||||
}
|
||||
|
||||
run_cmd() {
|
||||
local out err rc
|
||||
out="$({ err=$( { "$@"; } 2>&1 1>&3 ); rc=$?; echo "$err" >&2; echo $rc >&4; } 3>&1 4>&1)"
|
||||
}
|
||||
|
Reference in New Issue
Block a user