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

Function TestFloat64SliceFlagApply_UsesEnvValues_noDefault

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

Source from the content-addressed store, hash-verified

1578}
1579
1580func TestFloat64SliceFlagApply_UsesEnvValues_noDefault(t *testing.T) {
1581 t.Setenv("MY_GOAT", "1.0 , 2.0")
1582 fl := FloatSliceFlag{Name: "goat", Sources: EnvVars("MY_GOAT")}
1583 cmd := &Command{
1584 Flags: []Flag{
1585 &fl,
1586 },
1587 }
1588
1589 assert.NoError(t, cmd.Run(buildTestContext(t), []string{""}))
1590 assert.Equal(t, []float64{1, 2}, cmd.Value("goat"))
1591}
1592
1593func TestFloat64SliceFlagApply_UsesEnvValues_withDefault(t *testing.T) {
1594 t.Setenv("MY_GOAT", "1.0 , 2.0")

Callers

nothing calls this directly

Calls 4

RunMethod · 0.95
ValueMethod · 0.95
EnvVarsFunction · 0.85
buildTestContextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…