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

Function TestParseMultiIntSlice

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

Source from the content-addressed store, hash-verified

2073}
2074
2075func TestParseMultiIntSlice(t *testing.T) {
2076 _ = (&Command{
2077 Flags: []Flag{
2078 &Int64SliceFlag{Name: "serve", Aliases: []string{"s"}, Value: []int64{}},
2079 },
2080 Action: func(_ context.Context, cmd *Command) error {
2081 r := require.New(t)
2082
2083 r.Equalf([]int64{10, 20}, cmd.Int64Slice("serve"), "main name not set")
2084 r.Equalf([]int64{10, 20}, cmd.Int64Slice("s"), "short name not set")
2085
2086 return nil
2087 },
2088 }).Run(buildTestContext(t), []string{"run", "-s", "10", "-s", "20"})
2089}
2090
2091func TestParseMultiIntSliceWithDefaults(t *testing.T) {
2092 _ = (&Command{

Callers

nothing calls this directly

Calls 3

buildTestContextFunction · 0.85
Int64SliceMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected