mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-21 03:10:43 -06:00
adding tests for error
This commit is contained in:
@@ -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{
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user