da919f9f6e
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)
39 lines
1.1 KiB
Bash
39 lines
1.1 KiB
Bash
#!/bin/bash
|
|
# test_edit_prompt_middle_message.sh - Test edit middle message shows only immediate previous as context
|
|
|
|
test_name="edit_middle_message"
|
|
|
|
json=$(create_history_json user "msg0" assistant "msg1" tool "msg2")
|
|
|
|
OUTPUT=$("${DRHARNESS}" -W "$json" "2" "tool")
|
|
|
|
# Should show message 1 as context (immediate previous)
|
|
if ! echo "$OUTPUT" | grep -q "\[1\] assistant: msg1"; then
|
|
echo "FAIL: $test_name - should show message 1 as context"
|
|
echo "Got: $OUTPUT"
|
|
exit 1
|
|
fi
|
|
|
|
# Should NOT show message 0 in context
|
|
if echo "$OUTPUT" | grep -q "\[0\]"; then
|
|
echo "FAIL: $test_name - should not show message 0 in context"
|
|
echo "Got: $OUTPUT"
|
|
exit 1
|
|
fi
|
|
|
|
# Should show edit prompt for message 2
|
|
if ! echo "$OUTPUT" | grep -q "Edit message 2 (role: tool) below:"; then
|
|
echo "FAIL: $test_name - should show edit prompt for message 2"
|
|
echo "Got: $OUTPUT"
|
|
exit 1
|
|
fi
|
|
|
|
# Should show current content (msg2)
|
|
if ! echo "$OUTPUT" | grep -q "msg2"; then
|
|
echo "FAIL: $test_name - should show current content"
|
|
echo "Got: $OUTPUT"
|
|
exit 1
|
|
fi
|
|
|
|
echo "PASS: $test_name"
|