(t *testing.T)
| 168 | } |
| 169 | |
| 170 | func TestDSCalledTwice(t *testing.T) { |
| 171 | var ds []time.Duration |
| 172 | f := setUpDSFlagSet(&ds) |
| 173 | |
| 174 | in := []string{"1ns,2ns", "3ns"} |
| 175 | expected := []time.Duration{1, 2, 3} |
| 176 | argfmt := "--ds=%s" |
| 177 | arg1 := fmt.Sprintf(argfmt, in[0]) |
| 178 | arg2 := fmt.Sprintf(argfmt, in[1]) |
| 179 | err := f.Parse([]string{arg1, arg2}) |
| 180 | if err != nil { |
| 181 | t.Fatal("expected no error; got", err) |
| 182 | } |
| 183 | for i, v := range ds { |
| 184 | if expected[i] != v { |
| 185 | t.Fatalf("expected ds[%d] to be %d but got: %d", i, expected[i], v) |
| 186 | } |
| 187 | } |
| 188 | } |
nothing calls this directly
no test coverage detected