#!/usr/bin/env bash
set -euo pipefail

if [[ -z "${IN_NIX_SHELL:-}" ]] && command -v nix >/dev/null 2>&1; then
  exec nix develop -c "$0" "$@"
fi

echo "[verify] Running persistent snapshot recovery tests..."
cargo test -p flaredb-raft persistent_storage::tests::test_snapshot_persistence_and_recovery

echo "[verify] Running leader election tests..."
cargo test -p flaredb-raft raft_node::tests::test_leader_election

echo "[verify] Running server read-path tests..."
cargo test -p flaredb-server service::tests::scan_returns_decoded_cas_keys

echo "[verify] Done."
