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

Function TestFloat64SliceFlagValueFromCommand

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

Source from the content-addressed store, hash-verified

1620}
1621
1622func TestFloat64SliceFlagValueFromCommand(t *testing.T) {
1623 fl := FloatSliceFlag{Name: "myflag"}
1624 cmd := &Command{
1625 Flags: []Flag{
1626 &fl,
1627 },
1628 }
1629 assert.NoError(t, cmd.Run(buildTestContext(t), []string{""}))
1630 require.NoError(t, cmd.Set("myflag", "1.23"))
1631 require.NoError(t, cmd.Set("myflag", "4.56"))
1632 require.Equal(t, []float64{1.23, 4.56}, cmd.FloatSlice(fl.Name))
1633}
1634
1635func TestFloat64SliceFlagApply_ParentCommand(t *testing.T) {
1636 _ = (&Command{

Callers

nothing calls this directly

Calls 4

RunMethod · 0.95
SetMethod · 0.95
FloatSliceMethod · 0.95
buildTestContextFunction · 0.85

Tested by

no test coverage detected