- Published on
Test with a newly constructed struct array
- Authors
- Name
- Gene Zhang
func TestFunction(t *testing.T) {
assert := require.New(t)
for _, testCase := range []struct {
input string
expected []string
}{
{
input: "{a, b}",
expected: []string{},
},
{
input: "{2}",
expected: []string{"2"},
},
} {
assert.Equal(testCase.expected, SomeFunction(testCase.input))
}
}