Skip to content

Commit a282361

Browse files
committed
test cleanup
1 parent daae1c2 commit a282361

1 file changed

Lines changed: 3 additions & 53 deletions

File tree

cmd/src/abc_variables_set_test.go

Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,11 @@ func TestMarshalABCVariableValuePreservesLargeIntegerLiteral(t *testing.T) {
2323
}
2424
}
2525

26-
func TestMarshalABCVariableValueTreatsNullAsRemoval(t *testing.T) {
27-
t.Parallel()
28-
29-
value, remove, err := marshalABCVariableValue("null")
30-
if err != nil {
31-
t.Fatalf("marshalABCVariableValue returned error: %v", err)
32-
}
33-
if !remove {
34-
t.Fatal("marshalABCVariableValue did not mark null for removal")
35-
}
36-
if value != "null" {
37-
t.Fatalf("marshalABCVariableValue = %q, want %q", value, "null")
38-
}
39-
}
40-
4126
func TestParseABCVariables(t *testing.T) {
4227
t.Parallel()
4328

4429
variables, err := parseABCVariables(
45-
[]string{"prompt=tighten the review criteria", `title="null"`},
30+
[]string{"prompt=tighten the review criteria", `title="test"`},
4631
abcVariableArgs{"checkpoints=[1,2,3]"},
4732
)
4833
if err != nil {
@@ -57,47 +42,12 @@ func TestParseABCVariables(t *testing.T) {
5742
t.Fatalf("variables[0] = %#v, want prompt string variable", variables[0])
5843
}
5944

60-
if variables[1].Key != "title" || variables[1].Value != `"null"` {
61-
t.Fatalf("variables[1] = %#v, want quoted null string", variables[1])
45+
if variables[1].Key != "title" || variables[1].Value != `"test"` {
46+
t.Fatalf("variables[1] = %#v, want quoted test string", variables[1])
6247
}
6348

6449
if variables[2].Key != "checkpoints" || variables[2].Value != "[1,2,3]" {
6550
t.Fatalf("variables[2] = %#v, want compact JSON array", variables[2])
6651
}
6752
}
6853

69-
func TestParseABCVariablesRequiresAssignments(t *testing.T) {
70-
t.Parallel()
71-
72-
_, err := parseABCVariables(nil, nil)
73-
if err == nil {
74-
t.Fatal("parseABCVariables returned nil error, want usage error")
75-
}
76-
if _, ok := err.(*cmderrors.UsageError); !ok {
77-
t.Fatalf("parseABCVariables error = %T, want *cmderrors.UsageError", err)
78-
}
79-
}
80-
81-
func TestParseABCVariableRequiresNameValueFormat(t *testing.T) {
82-
t.Parallel()
83-
84-
_, err := parseABCVariable("missing-separator")
85-
if err == nil {
86-
t.Fatal("parseABCVariable returned nil error, want usage error")
87-
}
88-
if _, ok := err.(*cmderrors.UsageError); !ok {
89-
t.Fatalf("parseABCVariable error = %T, want *cmderrors.UsageError", err)
90-
}
91-
}
92-
93-
func TestParseABCVariableRejectsNullLiteral(t *testing.T) {
94-
t.Parallel()
95-
96-
_, err := parseABCVariable("approval=null")
97-
if err == nil {
98-
t.Fatal("parseABCVariable returned nil error, want usage error")
99-
}
100-
if _, ok := err.(*cmderrors.UsageError); !ok {
101-
t.Fatalf("parseABCVariable error = %T, want *cmderrors.UsageError", err)
102-
}
103-
}

0 commit comments

Comments
 (0)