gem/tests/long_prefix_candidate_contract.sh
2026-08-30 18:24:55 -06:00

24 lines
653 B
Bash
Executable file

#!/bin/sh
set -eu
[ "$#" -eq 1 ] || { echo "usage: $0 GEM_LONG_PREFIX_AB" >&2; exit 2; }
binary=$1
set +e
GEM_LONG_PREFIX_CANDIDATE=bk128 "$binary" /nonexistent/gemma.gguf 4096 3 \
>/dev/null 2>&1
bk128_status=$?
GEM_LONG_PREFIX_CANDIDATE=invalid "$binary" /nonexistent/gemma.gguf 4096 3 \
>/dev/null 2>&1
invalid_status=$?
set -e
# An accepted diagnostic mode reaches model opening (status 1); an invalid mode is usage (status 2).
[ "$bk128_status" -eq 1 ] || {
echo "bk128 diagnostic candidate was not accepted" >&2
exit 1
}
[ "$invalid_status" -eq 2 ] || {
echo "invalid diagnostic candidate was not rejected" >&2
exit 1
}