Files
troupe-standup/wizard-work/spark/verify_word_freq.sh
T

46 lines
972 B
Bash
Executable File

#!/bin/bash
# Verify word_freq.py artifact
set -e
cd /root/.hermes/wizard-outputs/spark
echo "=== Word Frequency Counter Verification ==="
# Check Python script exists
if [ -f "word_freq.py" ]; then
echo "[PASS] word_freq.py exists"
else
echo "[FAIL] word_freq.py missing"
exit 1
fi
# Check test input exists
if [ -f "test_words.txt" ]; then
echo "[PASS] test_words.txt exists"
else
echo "[FAIL] test_words.txt missing"
exit 1
fi
# Check expected output exists
if [ -f "word_freq_output.json" ]; then
echo "[PASS] word_freq_output.json exists"
else
echo "[FAIL] word_freq_output.json missing"
exit 1
fi
# Run tool and compare JSON output
python3 word_freq.py test_words.txt > temp_actual.json
if python3 validate_json_match.py; then
echo "[PASS] Tool output matches expected"
else
echo "[FAIL] Tool output mismatch"
cat temp_actual.json
exit 1
fi
echo ""
echo "=== VERIFICATION PASSED ==="
rm -f temp_actual.json