From 2cd1f22e68978f218ffcdf55cb6ef64e89a5d17b Mon Sep 17 00:00:00 2001 From: yusing Date: Thu, 6 Feb 2025 02:33:30 +0800 Subject: [PATCH] add test for the previous commit --- internal/utils/serialization_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/utils/serialization_test.go b/internal/utils/serialization_test.go index 23696e9a..24ac4518 100644 --- a/internal/utils/serialization_test.go +++ b/internal/utils/serialization_test.go @@ -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) {