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

echo "→ pre-push: running tests"

cargo test --all-targets 2>/dev/null
test_exit=$?

if [ $test_exit -ne 0 ]; then
  echo "❌ pre-push: tests failed. Push aborted."
  exit 1
fi

echo "✓ pre-push: all tests passed"
