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

Function TestUint64SliceFlagApply_ParentCommand

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

Source from the content-addressed store, hash-verified

1426}
1427
1428func TestUint64SliceFlagApply_ParentCommand(t *testing.T) {
1429 _ = (&Command{
1430 Flags: []Flag{
1431 &Uint64SliceFlag{Name: "numbers", Aliases: []string{"n"}, Value: []uint64{1, 2, 3}},
1432 },
1433 Commands: []*Command{
1434 {
1435 Name: "child",
1436 Action: func(_ context.Context, cmd *Command) error {
1437 require.Equalf(
1438 t, []uint64{1, 2, 3}, cmd.Uint64Slice("numbers"),
1439 "child context unable to view parent flag",
1440 )
1441 return nil
1442 },
1443 },
1444 },
1445 }).Run(buildTestContext(t), []string{"run", "child"})
1446}
1447
1448func TestUint64SliceFlag_SetFromParentCommand(t *testing.T) {
1449 fl := &Uint64SliceFlag{Name: "numbers", Aliases: []string{"n"}, Value: []uint64{1, 2, 3, 4}}

Callers

nothing calls this directly

Calls 3

buildTestContextFunction · 0.85
Uint64SliceMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected