#!/bin/bash
# Shared library for shell test scripts
# Source this file: source ./test_lib.sh
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Test counters
TESTS_RUN=0
TESTS_PASSED=0
TESTS_FAILED=0
# Project paths
SCRIPT_DIR=""
PROJECT_DIR=""
PRODUCTION_DB="/db/skraak.duckdb"
DEFAULT_TEST_DB="/db/test.duckdb"
# Check that skraak binary exists
# Create fresh test database from production
# Returns path to fresh test DB (in /tmp)
# Cleanup test database
# Send MCP request and get response
# Usage: send_request <method> <params_json> [db_path]
# Send multiple MCP requests in one session
# Usage: send_requests <db_path> <request1> <request2> ...
# Extract result from MCP response
# Check if response is an error
# Run a single test
# Usage: run_test <name> <expected_pass> <actual_result>
# Print test summary
# Extract ID from create response