42 lines
1.0 KiB
Bash
Executable File
42 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
# test_rebase_parser_all_commands.sh - Valid rebase file with all three commands
|
|
|
|
test_name="valid_rebase_all_commands"
|
|
|
|
content="pick 0 [user] hello world
|
|
edit 1 [assistant] ai response
|
|
drop 2 [tool] tool result"
|
|
|
|
OUTPUT=$("${DRHARNESS}" -z 3 "$content")
|
|
|
|
count=$(rebase_line_count "$OUTPUT")
|
|
if [ "$count" -ne 3 ]; then
|
|
echo "FAIL: $test_name - expected 3 lines, got $count"
|
|
echo "Got: $OUTPUT"
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$(rebase_command_at "$OUTPUT" 0)" != "pick" ]; then
|
|
echo "FAIL: $test_name - expected pick at 0"
|
|
exit 1
|
|
fi
|
|
if [ "$(rebase_index_at "$OUTPUT" 0)" != "0" ]; then
|
|
echo "FAIL: $test_name - expected index 0 at 0"
|
|
exit 1
|
|
fi
|
|
if [ "$(rebase_role_at "$OUTPUT" 0)" != "user" ]; then
|
|
echo "FAIL: $test_name - expected role user at 0"
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$(rebase_command_at "$OUTPUT" 1)" != "edit" ]; then
|
|
echo "FAIL: $test_name - expected edit at 1"
|
|
exit 1
|
|
fi
|
|
if [ "$(rebase_command_at "$OUTPUT" 2)" != "drop" ]; then
|
|
echo "FAIL: $test_name - expected drop at 2"
|
|
exit 1
|
|
fi
|
|
|
|
echo "PASS: $test_name"
|