Add new unit tests

This commit is contained in:
armirveliaj
2024-07-15 11:07:27 -04:00
committed by Dan Christian Bogos
parent f84e7c29a3
commit 8edc239bd1
3 changed files with 134 additions and 0 deletions

View File

@@ -481,3 +481,26 @@ func TestStructUpdateStructWithIfaceMap(t *testing.T) {
})
}
}
func TestToMapMapStringInterface(t *testing.T) {
type TestStruct struct {
Field1 string
Field2 int
Field3 bool
}
input := TestStruct{
Field1: "value1",
Field2: 42,
Field3: true,
}
expected := map[string]any{
"Field1": "value1",
"Field2": 42,
"Field3": true,
}
output := ToMapMapStringInterface(input)
if !reflect.DeepEqual(output, expected) {
t.Errorf("expected %v, got %v", expected, output)
}
}