Rename flag that was used in other branch
This commit is contained in:
+2
-2
@@ -247,7 +247,7 @@ int main(int argc, char** argv) {
|
||||
test_type_required_type = consume_arg();
|
||||
test_type_required_json = consume_arg();
|
||||
}
|
||||
else if (argv[0] == std::string("-P"))
|
||||
else if (argv[0] == std::string("-z"))
|
||||
{
|
||||
consume_arg();
|
||||
test_rebase_history_size = consume_arg();
|
||||
@@ -355,7 +355,7 @@ int main(int argc, char** argv) {
|
||||
<< " -E <string> Debug: test expect_or_exit success case and exit\n"
|
||||
<< " -e <string> Debug: test expect_or_exit error case and exit\n"
|
||||
<< " -R <type> <json> Debug: test json_to<Type>() for required fields and exit\n"
|
||||
<< " -P <size> <content> Debug: test rebase parser and exit\n"
|
||||
<< " -z <size> <content> Debug: test rebase parser and exit\n"
|
||||
<< " -Z <json> Debug: test build_rebase_content with JSON history and exit\n"
|
||||
<< " -A <lines> <history> Debug: test apply_rebase with JSON and exit\n"
|
||||
<< " -W <json> <index> <role> Debug: test build_edit_prompt and exit\n"
|
||||
|
||||
@@ -7,7 +7,7 @@ content="pick 0 [user] hello world
|
||||
edit 1 [assistant] ai response
|
||||
drop 2 [tool] tool result"
|
||||
|
||||
OUTPUT=$("${DRHARNESS}" -P 3 "$content")
|
||||
OUTPUT=$("${DRHARNESS}" -z 3 "$content")
|
||||
|
||||
count=$(rebase_line_count "$OUTPUT")
|
||||
if [ "$count" -ne 3 ]; then
|
||||
|
||||
@@ -7,7 +7,7 @@ content="pick 0 [user] hello
|
||||
pick 1 [assistant] response
|
||||
pick 2 [tool] result"
|
||||
|
||||
OUTPUT=$("${DRHARNESS}" -P 3 "$content")
|
||||
OUTPUT=$("${DRHARNESS}" -z 3 "$content")
|
||||
|
||||
if [ "$(rebase_role_at "$OUTPUT" 0)" != "user" ]; then
|
||||
echo "FAIL: $test_name - expected user role at 0"
|
||||
|
||||
@@ -12,7 +12,7 @@ edit 1 [assistant] response
|
||||
drop 2 [tool] result
|
||||
# Footer comment"
|
||||
|
||||
OUTPUT=$("${DRHARNESS}" -P 3 "$content")
|
||||
OUTPUT=$("${DRHARNESS}" -z 3 "$content")
|
||||
|
||||
count=$(rebase_line_count "$OUTPUT")
|
||||
if [ "$count" -ne 3 ]; then
|
||||
|
||||
@@ -8,7 +8,7 @@ pick 1 [assistant] response
|
||||
drop 0 [tool] duplicate"
|
||||
|
||||
set +e
|
||||
OUTPUT=$("${DRHARNESS}" -P 3 "$content" 2>&1) || true
|
||||
OUTPUT=$("${DRHARNESS}" -z 3 "$content" 2>&1) || true
|
||||
set -e
|
||||
|
||||
if ! echo "$OUTPUT" | grep -q "duplicate index 0"; then
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
test_name="empty_rebase"
|
||||
|
||||
OUTPUT=$("${DRHARNESS}" -P 3 "")
|
||||
OUTPUT=$("${DRHARNESS}" -z 3 "")
|
||||
|
||||
count=$(rebase_line_count "$OUTPUT")
|
||||
if [ "$count" -ne 0 ]; then
|
||||
|
||||
@@ -8,7 +8,7 @@ pick 10 [assistant] out of range
|
||||
drop 100 [tool] also out of range"
|
||||
|
||||
set +e
|
||||
OUTPUT=$("${DRHARNESS}" -P 3 "$content" 2>&1) || true
|
||||
OUTPUT=$("${DRHARNESS}" -z 3 "$content" 2>&1) || true
|
||||
set -e
|
||||
|
||||
if ! echo "$OUTPUT" | grep -q "invalid command: 'invalid'"; then
|
||||
|
||||
@@ -7,7 +7,7 @@ content="pick 0 [user] hello
|
||||
pick 10 [assistant] response"
|
||||
|
||||
set +e
|
||||
OUTPUT=$("${DRHARNESS}" -P 3 "$content" 2>&1) || true
|
||||
OUTPUT=$("${DRHARNESS}" -z 3 "$content" 2>&1) || true
|
||||
set -e
|
||||
|
||||
if ! echo "$OUTPUT" | grep -q "index 10 out of range"; then
|
||||
|
||||
@@ -7,7 +7,7 @@ content="pick 0 [user] hello
|
||||
squash 1 [assistant] response"
|
||||
|
||||
set +e
|
||||
OUTPUT=$("${DRHARNESS}" -P 3 "$content" 2>&1) || true
|
||||
OUTPUT=$("${DRHARNESS}" -z 3 "$content" 2>&1) || true
|
||||
set -e
|
||||
|
||||
if ! echo "$OUTPUT" | grep -q "invalid command: 'squash'"; then
|
||||
|
||||
@@ -6,7 +6,7 @@ test_name="invalid_command_digit"
|
||||
content="0 [user] no command"
|
||||
|
||||
set +e
|
||||
OUTPUT=$("${DRHARNESS}" -P 3 "$content" 2>&1) || true
|
||||
OUTPUT=$("${DRHARNESS}" -z 3 "$content" 2>&1) || true
|
||||
set -e
|
||||
|
||||
if ! echo "$OUTPUT" | grep -q "invalid command: '0'"; then
|
||||
|
||||
@@ -6,7 +6,7 @@ test_name="invalid_index"
|
||||
content="pick [user] no valid index"
|
||||
|
||||
set +e
|
||||
OUTPUT=$("${DRHARNESS}" -P 3 "$content" 2>&1) || true
|
||||
OUTPUT=$("${DRHARNESS}" -z 3 "$content" 2>&1) || true
|
||||
set -e
|
||||
|
||||
if ! echo "$OUTPUT" | grep -q "invalid index: '\[user\]'"; then
|
||||
|
||||
@@ -7,7 +7,7 @@ content="pick 0 [user] hello
|
||||
pick 1 [system] response"
|
||||
|
||||
set +e
|
||||
OUTPUT=$("${DRHARNESS}" -P 3 "$content" 2>&1) || true
|
||||
OUTPUT=$("${DRHARNESS}" -z 3 "$content" 2>&1) || true
|
||||
set -e
|
||||
|
||||
if ! echo "$OUTPUT" | grep -q "invalid role: '\[system\]'"; then
|
||||
|
||||
@@ -7,7 +7,7 @@ content="pick 0 [user] hello
|
||||
pick 1 assistant response"
|
||||
|
||||
set +e
|
||||
OUTPUT=$("${DRHARNESS}" -P 3 "$content" 2>&1) || true
|
||||
OUTPUT=$("${DRHARNESS}" -z 3 "$content" 2>&1) || true
|
||||
set -e
|
||||
|
||||
if ! echo "$OUTPUT" | grep -q "malformed role: 'assistant'"; then
|
||||
|
||||
@@ -6,7 +6,7 @@ test_name="missing_role"
|
||||
content="pick 0"
|
||||
|
||||
set +e
|
||||
OUTPUT=$("${DRHARNESS}" -P 3 "$content" 2>&1) || true
|
||||
OUTPUT=$("${DRHARNESS}" -z 3 "$content" 2>&1) || true
|
||||
set -e
|
||||
|
||||
if ! echo "$OUTPUT" | grep -q "missing role"; then
|
||||
|
||||
@@ -6,7 +6,7 @@ test_name="only_comments"
|
||||
content="# comment 1
|
||||
# comment 2"
|
||||
|
||||
OUTPUT=$("${DRHARNESS}" -P 3 "$content")
|
||||
OUTPUT=$("${DRHARNESS}" -z 3 "$content")
|
||||
|
||||
count=$(rebase_line_count "$OUTPUT")
|
||||
if [ "$count" -ne 0 ]; then
|
||||
|
||||
@@ -8,7 +8,7 @@ content="pick 0 [user] hello
|
||||
edit 1 [assistant] response
|
||||
drop 2 [tool] result"
|
||||
|
||||
OUTPUT=$("${DRHARNESS}" -P 3 "$content")
|
||||
OUTPUT=$("${DRHARNESS}" -z 3 "$content")
|
||||
|
||||
count=$(rebase_line_count "$OUTPUT")
|
||||
if [ "$count" -ne 3 ]; then
|
||||
|
||||
@@ -8,7 +8,7 @@ pick 0 [user] hello
|
||||
# Another comment
|
||||
edit 1 [assistant] response"
|
||||
|
||||
OUTPUT=$("${DRHARNESS}" -P 3 "$content")
|
||||
OUTPUT=$("${DRHARNESS}" -z 3 "$content")
|
||||
|
||||
count=$(rebase_line_count "$OUTPUT")
|
||||
if [ "$count" -ne 2 ]; then
|
||||
|
||||
@@ -9,7 +9,7 @@ edit 1 [assistant] response
|
||||
|
||||
drop 2 [tool] result"
|
||||
|
||||
OUTPUT=$("${DRHARNESS}" -P 3 "$content")
|
||||
OUTPUT=$("${DRHARNESS}" -z 3 "$content")
|
||||
|
||||
count=$(rebase_line_count "$OUTPUT")
|
||||
if [ "$count" -ne 3 ]; then
|
||||
|
||||
Reference in New Issue
Block a user