(t *testing.T)
| 398 | } |
| 399 | |
| 400 | func TestMapIntValue(t *testing.T) { |
| 401 | miv := map[string]int64{"k1": 10} |
| 402 | v := NewMapIntValue(miv) |
| 403 | _, ok := v.Get("k1") |
| 404 | assert.True(t, ok) |
| 405 | _, ok = v.Get("nope") |
| 406 | assert.Equal(t, false, ok) |
| 407 | assert.Equal(t, 1, v.MapValue().Len()) |
| 408 | lv := v.SliceValue() |
| 409 | assert.Equal(t, 1, len(lv)) |
| 410 | mi := v.MapInt() |
| 411 | assert.Equal(t, 1, len(mi)) |
| 412 | assert.Equal(t, int64(10), mi["k1"]) |
| 413 | mf := v.MapFloat() |
| 414 | assert.Equal(t, 1, len(mf)) |
| 415 | assert.Equal(t, float64(10), mf["k1"]) |
| 416 | |
| 417 | mv := v.MapValue() |
| 418 | assert.Equal(t, 1, mv.Len()) |
| 419 | assert.Equal(t, int64(10), mv.Val()["k1"].Value()) |
| 420 | } |
| 421 | func TestMapNumberValue(t *testing.T) { |
| 422 | mfv := map[string]float64{"k1": 10} |
| 423 | v := NewMapNumberValue(mfv) |
nothing calls this directly
no test coverage detected