(t *testing.T)
| 145 | } |
| 146 | |
| 147 | func TestI64SAsSliceValue(t *testing.T) { |
| 148 | var i64s []int64 |
| 149 | f := setUpI64SFlagSet(&i64s) |
| 150 | |
| 151 | in := []string{"1", "2"} |
| 152 | argfmt := "--is=%s" |
| 153 | arg1 := fmt.Sprintf(argfmt, in[0]) |
| 154 | arg2 := fmt.Sprintf(argfmt, in[1]) |
| 155 | err := f.Parse([]string{arg1, arg2}) |
| 156 | if err != nil { |
| 157 | t.Fatal("expected no error; got", err) |
| 158 | } |
| 159 | |
| 160 | f.VisitAll(func(f *Flag) { |
| 161 | if val, ok := f.Value.(SliceValue); ok { |
| 162 | _ = val.Replace([]string{"3"}) |
| 163 | } |
| 164 | }) |
| 165 | if len(i64s) != 1 || i64s[0] != 3 { |
| 166 | t.Fatalf("Expected ss to be overwritten with '3.1', but got: %v", i64s) |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | func TestI64SCalledTwice(t *testing.T) { |
| 171 | var is []int64 |
nothing calls this directly
no test coverage detected