mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
* Add (commented out) linters that we should introduce I went through the available linters and added (commented out) the ones I think we should work on in the near term. In other words, fix them, then uncomment them so they are enabled in CI. * linter: errchkjson * linter: ineffassign * linter: gosimple * linter: errname
33 lines
778 B
Go
33 lines
778 B
Go
// Copyright 2021 Molecula Corp. All rights reserved.
|
|
package ctl
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"io"
|
|
"testing"
|
|
|
|
"github.com/featurebasedb/featurebase/v3/logger"
|
|
)
|
|
|
|
func TestBackupCommand_Run(t *testing.T) {
|
|
cmLog := logger.NewStandardLogger(io.Discard)
|
|
cm := NewBackupCommand(cmLog)
|
|
cm.OutputDir = ""
|
|
err := cm.Run(context.Background())
|
|
if !errors.Is(err, ErrUsage) {
|
|
t.Fatalf("expected usage error, got %v", err)
|
|
}
|
|
cm.OutputDir = "foo"
|
|
cm.Concurrency = 0
|
|
err = cm.Run(context.Background())
|
|
if !errors.Is(err, ErrUsage) {
|
|
t.Fatalf("expected usage error, got %v", err)
|
|
}
|
|
cm.Concurrency = 1
|
|
cm.HeaderTimeoutStr = "until the cat wakes up"
|
|
err = cm.Run(context.Background())
|
|
if !errors.Is(err, ErrUsage) {
|
|
t.Fatalf("expected usage error, got %v", err)
|
|
}
|
|
}
|