MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / TestBuild_VariadicArgsRepeatable

Function TestBuild_VariadicArgsRepeatable

internal/cmdhelp/json_test.go:158–175  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

156}
157
158func 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
177func TestBuild_AlternationProducesEnum(t *testing.T) {
178 root := buildSyntheticTree()

Callers

nothing calls this directly

Calls 3

buildSyntheticTreeFunction · 0.85
BuildFunction · 0.85
FatalfMethod · 0.80

Tested by

no test coverage detected