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

Function TestIntSliceFlag_SetFromParentCommand

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

Source from the content-addressed store, hash-verified

1159}
1160
1161func TestIntSliceFlag_SetFromParentCommand(t *testing.T) {
1162 fl := &Int64SliceFlag{Name: "numbers", Aliases: []string{"n"}, Value: []int64{1, 2, 3, 4}}
1163
1164 cmd := &Command{
1165 parent: &Command{
1166 Flags: []Flag{
1167 fl,
1168 },
1169 },
1170 }
1171
1172 require.Equalf(t, []int64{1, 2, 3, 4}, cmd.Int64Slice("numbers"), "child context unable to view parent flag")
1173}
1174
1175func TestIntSliceFlagValueFromCommand(t *testing.T) {
1176 f := &Int64SliceFlag{Name: "myflag"}

Callers

nothing calls this directly

Calls 1

Int64SliceMethod · 0.95

Tested by

no test coverage detected