(t *testing.T)
| 180 | } |
| 181 | |
| 182 | func TestF32SCalledTwice(t *testing.T) { |
| 183 | var f32s []float32 |
| 184 | f := setUpF32SFlagSet(&f32s) |
| 185 | |
| 186 | in := []string{"1.0,2.0", "3.0"} |
| 187 | expected := []float32{1.0, 2.0, 3.0} |
| 188 | argfmt := "--f32s=%s" |
| 189 | arg1 := fmt.Sprintf(argfmt, in[0]) |
| 190 | arg2 := fmt.Sprintf(argfmt, in[1]) |
| 191 | err := f.Parse([]string{arg1, arg2}) |
| 192 | if err != nil { |
| 193 | t.Fatal("expected no error; got", err) |
| 194 | } |
| 195 | for i, v := range f32s { |
| 196 | if expected[i] != v { |
| 197 | t.Fatalf("expected f32s[%d] to be %f but got: %f", i, expected[i], v) |
| 198 | } |
| 199 | } |
| 200 | } |
nothing calls this directly
no test coverage detected