Skip to content

Commit 6d05a1c

Browse files
author
Openset
committed
Update: test file
1 parent 81160df commit 6d05a1c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

internal/leetcode/question_data.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,20 +184,22 @@ const testTpl = `package {{packageName}}
184184
import "testing"
185185
186186
type caseType struct {
187-
input interface{}
188-
expected interface{}
187+
input int
188+
expected int
189189
}
190190
191191
func Test{{funcName}}(t *testing.T) {
192192
tests := [...]caseType{
193193
{
194-
input: nil,
195-
expected: nil,
194+
input: 0,
195+
expected: 0,
196196
},
197197
}
198198
for _, tc := range tests {
199199
output := 0
200-
t.Fatalf("input: %v, output: %v, expected: %v", tc.input, output, tc.expected)
200+
if output != tc.expected {
201+
t.Fatalf("input: %v, output: %v, expected: %v", tc.input, output, tc.expected)
202+
}
201203
}
202204
}
203205
`

0 commit comments

Comments
 (0)