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

Function TestUint64SliceFlagApply_UsesEnvValues_noDefault

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

Source from the content-addressed store, hash-verified

1384}
1385
1386func TestUint64SliceFlagApply_UsesEnvValues_noDefault(t *testing.T) {
1387 t.Setenv("MY_GOAT", "1 , 2")
1388 fl := Uint64SliceFlag{Name: "goat", Sources: EnvVars("MY_GOAT")}
1389 cmd := &Command{
1390 Flags: []Flag{
1391 &fl,
1392 },
1393 }
1394 assert.NoError(t, cmd.Run(buildTestContext(t), []string{""}))
1395 assert.Equal(t, []uint64{1, 2}, cmd.Value("goat"))
1396}
1397
1398func TestUint64SliceFlagApply_UsesEnvValues_withDefault(t *testing.T) {
1399 t.Setenv("MY_GOAT", "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