949682a176
- test_rebase_apply_pick_preserves.sh - test_rebase_apply_drop_removes.sh - test_rebase_apply_edit_updates_role.sh - test_rebase_apply_edit_preserves_fields.sh - test_rebase_apply_implicit_pick.sh - test_rebase_apply_mixed_commands.sh - test_rebase_apply_empty_lines_preserves.sh - test_rebase_apply_lenient_orphaned_results.sh - test_rebase_apply_edit_preserves_tool_calls.sh - test_rebase_apply_deleting_lines_drops.sh - test_rebase_apply_all_lines_deleted_keeps.sh Removed the combined test_rebase_apply.sh file and updated CMakeLists.txt to include the 11 new individual test files.
36 lines
1.2 KiB
Bash
Executable File
36 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
# test_rebase_apply_deleting_lines_drops.sh - Deleting lines from rebase editor drops those messages (issue 120)
|
|
|
|
# Simulate editing a 6-item history where items 4 and 5 are deleted
|
|
# Only items 0-3 are mentioned in the commands
|
|
lines=$(create_rebase_lines pick 0 user pick 1 assistant pick 2 tool pick 3 assistant)
|
|
history=$(create_messages_json \
|
|
user "item 0" assistant "item 1" tool "item 2" assistant "item 3" \
|
|
user "item 4" assistant "item 5")
|
|
|
|
OUTPUT=$("${DRHARNESS}" -A "$lines" "$history")
|
|
|
|
# Should have 4 messages (items 4 and 5 dropped)
|
|
msg_count=$(echo "$OUTPUT" | grep -o '"role"' | wc -l)
|
|
|
|
if [ "$msg_count" -ne 4 ]; then
|
|
echo "FAIL: deleting_lines_drops_messages - expected 4 messages, got $msg_count"
|
|
echo "Got: $OUTPUT"
|
|
exit 1
|
|
fi
|
|
|
|
# Should not contain item 4 or item 5
|
|
if echo "$OUTPUT" | grep -q '"item 4"'; then
|
|
echo "FAIL: deleting_lines_drops_messages - item 4 should be dropped"
|
|
echo "Got: $OUTPUT"
|
|
exit 1
|
|
fi
|
|
|
|
if echo "$OUTPUT" | grep -q '"item 5"'; then
|
|
echo "FAIL: deleting_lines_drops_messages - item 5 should be dropped"
|
|
echo "Got: $OUTPUT"
|
|
exit 1
|
|
fi
|
|
|
|
echo "PASS: deleting_lines_drops_messages"
|