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