mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-21 15:18:44 +05:00
Add new unit tests
This commit is contained in:
committed by
Dan Christian Bogos
parent
f84e7c29a3
commit
8edc239bd1
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user