Published on

Test with a newly constructed struct array

Authors
  • avatar
    Name
    Gene Zhang
    Twitter
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))
	}
}