(t *testing.T)
| 184 | } |
| 185 | |
| 186 | func TestSerializeMap(t *testing.T) { |
| 187 | for _, referenceTracking := range []bool{false, true} { |
| 188 | fory := NewFory(WithXlang(true), WithCompatible(false), WithRefTracking(referenceTracking)) |
| 189 | // "str1" is deserialized by interface type, which will be set to map key whose type is string. |
| 190 | // so we need to save interface dynamic value type instead of interface value in reference resolver. |
| 191 | { |
| 192 | value := []any{"str1", map[string]any{"str1": "str2"}} |
| 193 | serde(t, fory, value) |
| 194 | } |
| 195 | { |
| 196 | value := map[string]any{"k1": "v1", "str": "", "": ""} |
| 197 | serde(t, fory, value) |
| 198 | } |
| 199 | { |
| 200 | value := map[string]int32{ |
| 201 | "k1": MinInt32, |
| 202 | "k2": 0, |
| 203 | "k3": MaxInt32, |
| 204 | } |
| 205 | serde(t, fory, value) |
| 206 | } |
| 207 | for _, data := range commonMap() { |
| 208 | serde(t, fory, data) |
| 209 | } |
| 210 | serde(t, fory, commonMap()) |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | func TestSerializeSet(t *testing.T) { |
| 215 | for _, referenceTracking := range []bool{false, true} { |
nothing calls this directly
no test coverage detected