MCPcopy
hub / github.com/spf13/pflag / TestEmptyF32S

Function TestEmptyF32S

float32_slice_test.go:26–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24}
25
26func TestEmptyF32S(t *testing.T) {
27 var f32s []float32
28 f := setUpF32SFlagSet(&f32s)
29 err := f.Parse([]string{})
30 if err != nil {
31 t.Fatal("expected no error; got", err)
32 }
33
34 getF32S, err := f.GetFloat32Slice("f32s")
35 if err != nil {
36 t.Fatal("got an error from GetFloat32Slice():", err)
37 }
38 if len(getF32S) != 0 {
39 t.Fatalf("got f32s %v with len=%d but expected length=0", getF32S, len(getF32S))
40 }
41}
42
43func TestF32S(t *testing.T) {
44 var f32s []float32

Callers

nothing calls this directly

Calls 3

setUpF32SFlagSetFunction · 0.85
GetFloat32SliceMethod · 0.80
ParseMethod · 0.65

Tested by

no test coverage detected