Add BATS tests for call dolt_branch -m

This commit is contained in:
Nick Tobey
2023-06-08 12:55:58 -07:00
parent e48e1520a9
commit 3f3acf351c
2 changed files with 22 additions and 0 deletions

View File

@@ -192,3 +192,13 @@ SQL
[ "$status" -eq 0 ]
[[ ! "$output" =~ "origin/b1" ]] || false
}
@test "sql-branch: CALL DOLT_BRANCH -m on session active branch (dolt sql)" {
dolt branch other
echo "call dolt_checkout('other'); call dolt_branch('-m', 'other', 'newOther')" | dolt sql
run dolt branch
[ $status -eq 0 ]
[[ "$output" =~ "newOther" ]] || false
[[ "$output" =~ "main" ]] || false
[[ ! "$output" =~ "other" ]] || false
}

View File

@@ -1924,3 +1924,15 @@ behavior:
[ $status -eq 0 ]
[[ "$output" =~ "0x1C4C4E338AD7442184509D5182816AC3" ]] || false
}
@test "sql-server: CALL DOLT_BRANCH -m on session active branch (dolt sql-server)" {
cd repo1
dolt branch other
start_sql_server
dolt sql-client -P $PORT -u dolt --use-db repo1 -q "call dolt_checkout('other'); call dolt_branch('-m', 'other', 'newOther')"
run dolt branch
[ $status -eq 0 ]
[[ "$output" =~ "newOther" ]] || false
[[ "$output" =~ "main" ]] || false
[[ ! "$output" =~ "other" ]] || false
}