Files
drharness/tests/test_smoke_tool_call.sh

25 lines
674 B
Bash
Executable File

#!/bin/bash
# test_smoke_tool_call.sh - Verifies drharness handles tool calls correctly
cat > "test_file.txt" << EOF
This is a test of the emergency broadcast system.
This is only a test
EOF
tool_call read_file '{"path":"test_file.txt"}' >> mock_responses.txt
be_done 'Done reading' >> mock_responses.txt
OUTPUT=$("${DRHARNESS}" -F chat.json -n -m "Read the file" -t read_file -d < "mock_responses.txt")
if [ "${OUTPUT}" != "Done reading" ]; then
echo "FAIL: smoke_tool_call - expected to be 'Done reading'"
echo "Output was: ${OUTPUT}"
exit 1
fi
echo "" >> test_file.txt # Always the tool result adds a newline
check_tool_call chat.json 2 test_file.txt