add dolt commit bats test with multiple branches

This commit is contained in:
Stephanie You
2023-06-15 16:23:57 -07:00
parent ba7e8b46d7
commit 20df6696da
+25 -1
View File
@@ -174,4 +174,28 @@ SQL
run dolt status
[ $status -eq 0 ]
[[ "$output" =~ "new table: t2" ]] || false
}
}
@test "commit: dolt commit works correctly with multiple branches" {
dolt branch branch2
dolt checkout -b branch1
dolt sql -q "CREATE table t1 (pk int primary key);"
dolt add t1
run dolt commit -m "adding table t1 on branch1"
[ $status -eq 0 ]
[[ "$output" =~ "adding table t1 on branch1" ]] || false
dolt checkout branch2
dolt sql -q "CREATE table t2 (pk int primary key);"
dolt add t2
run dolt commit -m "adding table t2 on branch2"
[ $status -eq 0 ]
[[ "$output" =~ "adding table t2 on branch2" ]] || false
run dolt log
[ $status -eq 0 ]
[[ "$output" =~ "adding table t2 on branch2" ]] || false
[[ ! "$output" =~ "adding table t1 on branch1" ]] || false
}