Files
drharness/tests/test_edit_prompt_first_message.sh
hal9000 da919f9f6e Merge origin/master into work branch (issue #169)
Resolved merge conflicts:
- CMakeLists.txt: Added both rebase_engine/utility and base64_util sources
- src/harness.cpp: Combined Content type with proper error handling
- src/main.cpp: Merged includes, test flags, and CLI parsing
  - Renamed conflicting flags: -B→-Z (build_rebase), -T→-W (edit_prompt), -b→-K (base64_decode)
- tests/CMakeLists.txt: Added all test targets from both branches
- src/rebase_engine.cpp: Fixed to use get_content_string() for Content variant type
- Updated test files to use new flag names (-Z, -W, -K)
2026-06-15 22:52:29 +00:00

46 lines
1.2 KiB
Bash

#!/bin/bash
# test_edit_prompt_first_message.sh - Test edit first message (no previous message)
test_name="edit_first_message"
json=$(create_history_json user "hello" assistant "hi there")
OUTPUT=$("${DRHARNESS}" -W "$json" "0" "user")
# Check for "no previous message" text
if ! echo "$OUTPUT" | grep -q "# (no previous message)"; then
echo "FAIL: $test_name - should show no previous message"
echo "Got: $OUTPUT"
exit 1
fi
# Should not have "Previous message:" header
if echo "$OUTPUT" | grep -q "# Previous message:"; then
echo "FAIL: $test_name - should not show previous message header for index 0"
echo "Got: $OUTPUT"
exit 1
fi
# Check for separator
if ! echo "$OUTPUT" | grep -q -- "-- >8 --"; then
echo "FAIL: $test_name - missing separator"
echo "Got: $OUTPUT"
exit 1
fi
# Check for edit prompt
if ! echo "$OUTPUT" | grep -q "Edit message 0 (role: user) below:"; then
echo "FAIL: $test_name - missing edit prompt"
echo "Got: $OUTPUT"
exit 1
fi
# Check for current content
if ! echo "$OUTPUT" | grep -q "hello"; then
echo "FAIL: $test_name - missing current content"
echo "Got: $OUTPUT"
exit 1
fi
echo "PASS: $test_name"