From 543b093afe8a7f60e7b4b5964e91890bf478b220 Mon Sep 17 00:00:00 2001 From: "guozhi.li" Date: Thu, 18 Jan 2024 15:09:12 +0800 Subject: [PATCH] ut --- pkg/set/stringset_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkg/set/stringset_test.go b/pkg/set/stringset_test.go index 442c774ad..278313135 100644 --- a/pkg/set/stringset_test.go +++ b/pkg/set/stringset_test.go @@ -414,6 +414,24 @@ func TestStringSet_UnmarshalJSON(t *testing.T) { }, wantErr: false, }, + { + name: "test floats", + set: NewStringSet(), + args: args{ + data: []byte(`[1.1,2.2]`), + expectResult: []string{"1.1", "2.2"}, + }, + wantErr: false, + }, + { + name: "test float", + set: NewStringSet(), + args: args{ + data: []byte(`1.1`), + expectResult: []string{"1.1"}, + }, + wantErr: false, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {