#!/usr/bin/env bash
# ok — the tiny test runner for Claude Code Nano (a homage to CS61A's `ok`).
#
#   ./ok        run every problem's tests
#   ./ok 05     run just one lecture's tests (matches tests/05_*.test.ts)
#
# Model calls in the suite are faked, so this runs offline and free.
set -euo pipefail
cd "$(dirname "$0")"

if [ "$#" -eq 0 ]; then
  echo "ok: running tests for ALL problems"
  exec npx vitest run
else
  printf 'ok: running tests for problem %s\n' "$1"
  exec npx vitest run "tests/$1"
fi
