(t *testing.T)
| 293 | } |
| 294 | |
| 295 | func TestProperties(t *testing.T) { |
| 296 | n := testdata.NewNodeEmbed() |
| 297 | |
| 298 | n.SetProperty("intprop", 42) |
| 299 | assert.Equal(t, 42, n.Property("intprop")) |
| 300 | |
| 301 | n.SetProperty("floatprop", 42.0) |
| 302 | assert.Equal(t, 42.0, n.Property("floatprop")) |
| 303 | |
| 304 | n.SetProperty("stringprop", "test string") |
| 305 | assert.Equal(t, "test string", n.Property("stringprop")) |
| 306 | |
| 307 | n.DeleteProperty("floatprop") |
| 308 | assert.Equal(t, nil, n.Property("floatprop")) |
| 309 | |
| 310 | assert.Equal(t, nil, n.Property("randomprop")) |
| 311 | |
| 312 | assert.Equal(t, map[string]any{"intprop": 42, "stringprop": "test string"}, n.Properties) |
| 313 | } |
| 314 | |
| 315 | func TestPropertiesJSON(t *testing.T) { |
| 316 | testProperties := map[string]any{ |
nothing calls this directly
no test coverage detected