(t *testing.T)
| 156 | } |
| 157 | |
| 158 | func TestBuild_VariadicArgsRepeatable(t *testing.T) { |
| 159 | root := buildSyntheticTree() |
| 160 | doc := Build(root, root, Options{Binary: "padtest", MaxDepth: -1}) |
| 161 | |
| 162 | bulk := doc.Commands["item bulk-update"] |
| 163 | if len(bulk.Args) != 1 { |
| 164 | t.Fatalf("item bulk-update: expected 1 positional arg (embedded --status filtered), got %d: %+v", len(bulk.Args), bulk.Args) |
| 165 | } |
| 166 | if bulk.Args[0].Name != "ref" { |
| 167 | t.Errorf("expected arg name 'ref', got %q", bulk.Args[0].Name) |
| 168 | } |
| 169 | if !bulk.Args[0].Required { |
| 170 | t.Errorf("expected <ref>... to be required") |
| 171 | } |
| 172 | if !bulk.Args[0].Repeatable { |
| 173 | t.Errorf("expected <ref>... to be marked repeatable (variadic)") |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | func TestBuild_AlternationProducesEnum(t *testing.T) { |
| 178 | root := buildSyntheticTree() |
nothing calls this directly
no test coverage detected