Add additional bats tests for dolt_ignore.

This commit is contained in:
Nick Tobey
2023-04-27 11:23:29 -07:00
parent 0d9356a15b
commit e38e4eb6fc
+31 -2
View File
@@ -132,14 +132,43 @@ SQL
[[ "$output" =~ "not ignored: commit_*" ]] || false
}
@test "ignore: stash ignored and untracked tables when --all is passed" {
dolt sql <<SQL
CREATE TABLE ignoreme (pk int);
CREATE TABLE dontignore (pk int);
SQL
dolt stash -a
working=$(get_working_tables)
[[ -z $(echo "$working" | grep "ignoreme") ]] || false
[[ -z $(echo "$working" | grep "dontignore") ]] || false
dolt stash pop
working=$(get_working_tables)
[[ ! -z $(echo "$working" | grep "ignoreme") ]] || false
[[ ! -z $(echo "$working" | grep "dontignore") ]] || false
}
@test "ignore: stash table with dolt_ignore conflict when --all is passed" {
dolt sql <<SQL
CREATE TABLE commit_ignore (pk int);
SQL
run dolt stash -a
dolt stash -a
[ "$status" -eq 0 ]
working=$(get_working_tables)
[[ -z $(echo "$working" | grep "commit_ignore") ]] || false
dolt stash pop
working=$(get_working_tables)
[[ ! -z $(echo "$working" | grep "commit_ignore") ]] || false
}