Skip to content

Commit 255f80b

Browse files
committed
Fixed test.
1 parent cf3d1f9 commit 255f80b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

go/ai/action_test.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ func defineProgrammableModel(r *registry.Registry) *programmableModel {
6363
}
6464

6565
func TestGenerateAction(t *testing.T) {
66-
cmpopts := cmp.Options{
67-
cmpopts.EquateEmpty(),
68-
}
69-
7066
data, err := os.ReadFile("../../tests/specs/generate.yaml")
7167
if err != nil {
7268
t.Fatalf("failed to read spec file: %v", err)
@@ -105,6 +101,9 @@ func TestGenerateAction(t *testing.T) {
105101
}
106102
resp := tc.ModelResponses[reqCounter]
107103
resp.Request = req
104+
resp.Custom = map[string]any{}
105+
resp.Request.Output = &ModelRequestOutput{}
106+
resp.Usage = &GenerationUsage{}
108107
reqCounter++
109108
return resp, nil
110109
}
@@ -128,7 +127,7 @@ func TestGenerateAction(t *testing.T) {
128127
t.Errorf("chunks mismatch (-want +got):\n%s", diff)
129128
}
130129

131-
if diff := cmp.Diff(tc.ExpectResponse, resp, cmpopts); diff != "" {
130+
if diff := cmp.Diff(tc.ExpectResponse, resp, cmp.Options{cmpopts.EquateEmpty()}); diff != "" {
132131
t.Errorf("response mismatch (-want +got):\n%s", diff)
133132
}
134133
} else {
@@ -137,7 +136,7 @@ func TestGenerateAction(t *testing.T) {
137136
t.Fatalf("action failed: %v", err)
138137
}
139138

140-
if diff := cmp.Diff(tc.ExpectResponse, resp, cmpopts); diff != "" {
139+
if diff := cmp.Diff(tc.ExpectResponse, resp, cmp.Options{cmpopts.EquateEmpty()}); diff != "" {
141140
t.Errorf("response mismatch (-want +got):\n%s", diff)
142141
}
143142
}

0 commit comments

Comments
 (0)