adding tests for error

This commit is contained in:
James Cor
2022-02-11 14:04:21 -08:00
parent 8528893eb8
commit b90dbd8135
2 changed files with 7 additions and 1 deletions

View File

@@ -126,7 +126,7 @@ func (cmd LogCmd) logWithLoggerFunc(ctx context.Context, commandStr string, args
switch decorateOption {
case "short", "full", "auto", "no":
default:
cli.PrintErrln(color.HiRedString("fatal : invalid --decorate option: " + decorateOption))
cli.PrintErrln(color.HiRedString("fatal: invalid --decorate option: " + decorateOption))
return 1
}
opts := logOpts{

View File

@@ -372,6 +372,12 @@ teardown() {
[ "$res" -eq 4 ] # exactly 1 line is added
}
@test "log: --decorate=notanoption throws error" {
run dolt log --decorate=notanoption
[ "$status" -eq 1 ]
[[ "$output" =~ "fatal: invalid --decorate option" ]] || false
}
@test "log: check pager" {
skiponwindows "Need to install expect and make this script work on windows."
dolt commit --allow-empty -m "commit 1"