#!/bin/bash

# Basic functionality test script
set -e

echo "🧪 Claude-Utils Basic Test"
echo "========================="
echo ""

# Try to compile
echo "1️⃣ Checking if code compiles..."
if command -v cargo &> /dev/null; then
    cargo check --all-targets
    echo "✅ Code compiles!"
else
    echo "⚠️  Cargo not found, skipping compile check"
fi

# Test basic clipboard operations (if built)
if [ -f "target/release/claude-utils" ] || [ -f "target/debug/claude-utils" ]; then
    BIN="target/release/claude-utils"
    [ ! -f "$BIN" ] && BIN="target/debug/claude-utils"
    
    echo ""
    echo "2️⃣ Testing basic CLI..."
    $BIN --version
    $BIN --help
    
    echo ""
    echo "3️⃣ Testing clipboard read..."
    $BIN clip get || echo "Clipboard might be empty"
    
    echo ""
    echo "✅ Basic tests passed!"
else
    echo "⚠️  Binary not found. Run 'cargo build' first"
fi