(t *testing.T)
| 253 | } |
| 254 | |
| 255 | func TestSSAsSliceValue(t *testing.T) { |
| 256 | var ss []string |
| 257 | f := setUpSSFlagSet(&ss) |
| 258 | |
| 259 | in := []string{"one", "two"} |
| 260 | argfmt := "--ss=%s" |
| 261 | arg1 := fmt.Sprintf(argfmt, in[0]) |
| 262 | arg2 := fmt.Sprintf(argfmt, in[1]) |
| 263 | err := f.Parse([]string{arg1, arg2}) |
| 264 | if err != nil { |
| 265 | t.Fatal("expected no error; got", err) |
| 266 | } |
| 267 | |
| 268 | f.VisitAll(func(f *Flag) { |
| 269 | if val, ok := f.Value.(SliceValue); ok { |
| 270 | _ = val.Replace([]string{"three"}) |
| 271 | } |
| 272 | }) |
| 273 | if len(ss) != 1 || ss[0] != "three" { |
| 274 | t.Fatalf("Expected ss to be overwritten with 'three', but got: %s", ss) |
| 275 | } |
| 276 | } |
nothing calls this directly
no test coverage detected