Skip to content

Commit 3bcf818

Browse files
committed
remove unnecessary tests
1 parent 238cf6f commit 3bcf818

1 file changed

Lines changed: 4 additions & 27 deletions

File tree

cmd/src/abc_variables_delete_test.go

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"testing"
55

6-
"github.com/sourcegraph/src-cli/internal/cmderrors"
6+
"github.com/google/go-cmp/cmp"
77
)
88

99
func TestParseABCVariableNames(t *testing.T) {
@@ -20,31 +20,8 @@ func TestParseABCVariableNames(t *testing.T) {
2020
if len(variableNames) != 3 {
2121
t.Fatalf("len(variableNames) = %d, want 3", len(variableNames))
2222
}
23-
if variableNames[0] != "approval" || variableNames[1] != "checkpoints" || variableNames[2] != "prompt" {
24-
t.Fatalf("variableNames = %#v, want [approval checkpoints prompt]", variableNames)
25-
}
26-
}
27-
28-
func TestParseABCVariableNamesRequiresAtLeastOneName(t *testing.T) {
29-
t.Parallel()
30-
31-
_, err := parseABCVariableNames(nil, nil)
32-
if err == nil {
33-
t.Fatal("parseABCVariableNames returned nil error, want usage error")
34-
}
35-
if _, ok := err.(*cmderrors.UsageError); !ok {
36-
t.Fatalf("parseABCVariableNames error = %T, want *cmderrors.UsageError", err)
37-
}
38-
}
39-
40-
func TestParseABCVariableNamesRejectsEmptyNames(t *testing.T) {
41-
t.Parallel()
42-
43-
_, err := parseABCVariableNames([]string{"approval", ""}, nil)
44-
if err == nil {
45-
t.Fatal("parseABCVariableNames returned nil error, want usage error")
46-
}
47-
if _, ok := err.(*cmderrors.UsageError); !ok {
48-
t.Fatalf("parseABCVariableNames error = %T, want *cmderrors.UsageError", err)
23+
want := []string{"approval", "checkpoints", "prompt"}
24+
if diff := cmp.Diff(want, variableNames); diff != "" {
25+
t.Fatalf("variableNames mismatch (-want +got):\n%s", diff)
4926
}
5027
}

0 commit comments

Comments
 (0)