mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-21 08:21:51 +02:00
add test for the previous commit
This commit is contained in:
@@ -186,6 +186,13 @@ func TestStringToSlice(t *testing.T) {
|
|||||||
ExpectNoError(t, err)
|
ExpectNoError(t, err)
|
||||||
ExpectDeepEqual(t, dst, []string{"a", "b", "c"})
|
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) {
|
func BenchmarkStringToSlice(b *testing.B) {
|
||||||
|
|||||||
Reference in New Issue
Block a user