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

Function TestFloat64SliceFlagApply_ParentCommand

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

Source from the content-addressed store, hash-verified

1633}
1634
1635func TestFloat64SliceFlagApply_ParentCommand(t *testing.T) {
1636 _ = (&Command{
1637 Flags: []Flag{
1638 &FloatSliceFlag{Name: "numbers", Aliases: []string{"n"}, Value: []float64{1.0, 2.0, 3.0}},
1639 },
1640 Commands: []*Command{
1641 {
1642 Name: "child",
1643 Action: func(_ context.Context, cmd *Command) error {
1644 require.Equalf(t, []float64{1.0, 2.0, 3.0}, cmd.FloatSlice("numbers"), "child context unable to view parent flag")
1645 return nil
1646 },
1647 },
1648 },
1649 }).Run(buildTestContext(t), []string{"run", "child"})
1650}
1651
1652var genericFlagTests = []struct {
1653 name string

Callers

nothing calls this directly

Calls 3

buildTestContextFunction · 0.85
FloatSliceMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected