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

Function TestParseMultiFloat64SliceFromEnvCascade

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

Source from the content-addressed store, hash-verified

2244}
2245
2246func TestParseMultiFloat64SliceFromEnvCascade(t *testing.T) {
2247 t.Setenv("APP_INTERVALS", "0.1234,-10.5")
2248
2249 _ = (&Command{
2250 Flags: []Flag{
2251 &FloatSliceFlag{Name: "intervals", Aliases: []string{"i"}, Value: []float64{}, Sources: EnvVars("COMPAT_INTERVALS", "APP_INTERVALS")},
2252 },
2253 Action: func(_ context.Context, cmd *Command) error {
2254 require.Equalf(t, []float64{0.1234, -10.5}, cmd.FloatSlice("intervals"), "main name not set from env")
2255 return nil
2256 },
2257 }).Run(buildTestContext(t), []string{"run"})
2258}
2259
2260func TestParseMultiBool(t *testing.T) {
2261 _ = (&Command{

Callers

nothing calls this directly

Calls 4

EnvVarsFunction · 0.85
buildTestContextFunction · 0.85
FloatSliceMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected