fixed some bats tests (#698)

This commit is contained in:
Brian Hendriks
2020-05-26 08:44:11 -07:00
committed by GitHub
parent 1e3ecfec9f
commit cdc4743d64
3 changed files with 25 additions and 5 deletions

View File

@@ -337,7 +337,13 @@ teardown() {
dolt branch test
run dolt checkout test
[ "$status" -eq 0 ]
skip "behavior ambiguous right now. should reset test table and switch to branch per git"
# Checks out branch "test" table "test" unaltered. Matches git behavior for:
#
# git init
# git commit --allow-empty -m "create"
# touch test
# git branch test
# git checkout test
}
@test "make a change on a different branch, commit, and merge to master" {

View File

@@ -41,7 +41,6 @@ teardown() {
[ "$status" -eq 1 ]
[[ "$output" =~ "wrong number of arguments" ]] || false
run dolt config --global --add
skip "dolt config --global --add with no name value pair currently succeeds"
[ "$status" -eq 1 ]
[[ "$output" =~ "wrong number of arguments" ]] || false
}
@@ -111,9 +110,24 @@ teardown() {
run dolt config --local --get test
[ "$status" -eq 0 ]
[ "$output" = "local" ]
# will list both global and local values in list output
run dolt config --list
[ "$status" -eq 0 ]
skip "list option in config does not respect local overrides"
[[ "$output" =~ "test = local" ]] || false
[[ ! "$output" =~ "test = global" ]] || false
[[ "$output" =~ "test = global" ]] || false
# will get the local value explicitly
run dolt config --get --local test
[ "$status" -eq 0 ]
[[ "$output" =~ "local" ]] || false
[[ ! "$output" =~ "global" ]] || false
# will get the global value explicitly
run dolt config --get --global test
[ "$status" -eq 0 ]
[[ "$output" =~ "global" ]] || false
[[ ! "$output" =~ "local" ]] || false
# will get the local value implicitly
run dolt config --get test
[ "$status" -eq 0 ]
[[ "$output" =~ "local" ]] || false
[[ ! "$output" =~ "global" ]] || false
}

View File

@@ -174,7 +174,7 @@ func getOperation(dEnv *env.DoltEnv, setCfgTypes *set.StrSet, args []string, pri
}
func addOperation(dEnv *env.DoltEnv, setCfgTypes *set.StrSet, args []string, usage cli.UsagePrinter) int {
if len(args)%2 != 0 {
if len(args) == 0 || len(args)%2 != 0 {
cli.Println("error: wrong number of arguments")
usage()
return 1