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

Function TestUint64SliceFlagApply_UsesEnvValues_withDefault

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

Source from the content-addressed store, hash-verified

1396}
1397
1398func TestUint64SliceFlagApply_UsesEnvValues_withDefault(t *testing.T) {
1399 t.Setenv("MY_GOAT", "1 , 2")
1400 val := []uint64{3, 4}
1401 fl := Uint64SliceFlag{Name: "goat", Sources: EnvVars("MY_GOAT"), Value: val}
1402 cmd := &Command{
1403 Flags: []Flag{
1404 &fl,
1405 },
1406 }
1407 assert.NoError(t, cmd.Run(buildTestContext(t), []string{""}))
1408 assert.Equal(t, []uint64{1, 2}, cmd.Value("goat"))
1409}
1410
1411func TestUint64SliceFlagApply_DefaultValueWithDestination(t *testing.T) {
1412 defValue := []uint64{1, 2}

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