MCPcopy
hub / github.com/urfave/cli / TestNonStringMap

Function TestNonStringMap

flag_test.go:3397–3416  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3395}
3396
3397func TestNonStringMap(t *testing.T) {
3398 type (
3399 floatMap = MapBase[float64, NoConfig, floatValue[float64]]
3400 )
3401
3402 p := map[string]float64{}
3403
3404 var fv floatValue[float64]
3405
3406 f := &floatMap{
3407 value: &fv,
3408 }
3409
3410 assert.Equal(t, map[string]float64{}, f.Value())
3411 f.dict = &p
3412 assert.Equal(t, map[string]float64{}, f.Value())
3413 assert.Equal(t, "map[string]float64{}", f.String())
3414
3415 assert.ErrorContains(t, f.Set("invalid=value"), "ParseFloat")
3416}
3417
3418func TestUnquoteUsage(t *testing.T) {
3419 tests := []struct {

Callers

nothing calls this directly

Calls 3

SetMethod · 0.65
ValueMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected