add test for the previous commit

This commit is contained in:
yusing 2025-02-06 02:33:30 +08:00
parent 688f38943d
commit 2cd1f22e68

View file

@ -186,6 +186,13 @@ func TestStringToSlice(t *testing.T) {
ExpectNoError(t, err)
ExpectDeepEqual(t, dst, []string{"a", "b", "c"})
})
t.Run("single-line-yaml-like", func(t *testing.T) {
dst := make([]string, 0)
convertible, err := ConvertString("- a", reflect.ValueOf(&dst))
ExpectTrue(t, convertible)
ExpectNoError(t, err)
ExpectDeepEqual(t, dst, []string{"a"})
})
}
func BenchmarkStringToSlice(b *testing.B) {