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

Function TestUint64SliceFlagApply_ParentContext

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

Source from the content-addressed store, hash-verified

1280}
1281
1282func TestUint64SliceFlagApply_ParentContext(t *testing.T) {
1283 _ = (&Command{
1284 Flags: []Flag{
1285 &Uint64SliceFlag{Name: "numbers", Aliases: []string{"n"}, Value: []uint64{1, 2, 3}},
1286 },
1287 Commands: []*Command{
1288 {
1289 Name: "child",
1290 Action: func(_ context.Context, cmd *Command) error {
1291 require.Equalf(
1292 t, []uint64{1, 2, 3}, cmd.Uint64Slice("numbers"),
1293 "child context unable to view parent flag",
1294 )
1295 return nil
1296 },
1297 },
1298 },
1299 }).Run(buildTestContext(t), []string{"run", "child"})
1300}
1301
1302func TestUintSliceFlag_SetFromParentCommand(t *testing.T) {
1303 fl := &UintSliceFlag{Name: "numbers", Aliases: []string{"n"}, Value: []uint{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