Remove unused parser resource plumbing
This commit is contained in:
@@ -34,15 +34,14 @@ func TestAppParseUsesRegisteredBindingsWithTheAdapter(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
options := commandmeta.ParseOptions{Context: context.Background()}
|
||||
result := app.parse([]string{"config", "show", "one", "--scope", "app"}, options)
|
||||
result := parseReportingArgs(app, []string{"config", "show", "one", "--scope", "app"})
|
||||
if result.Failure != nil {
|
||||
t.Fatalf("parse failed: %s", result.Failure.Message)
|
||||
}
|
||||
if !reflect.DeepEqual(result.Path, []string{"config", "show"}) || !reflect.DeepEqual(result.FlagValues, [][]string{{"app"}}) || !reflect.DeepEqual(result.Operands, []string{"one"}) {
|
||||
t.Fatalf("parse result = %#v", result)
|
||||
}
|
||||
result = app.parse([]string{"config", "--scope", "app", "show"}, options)
|
||||
result = parseReportingArgs(app, []string{"config", "--scope", "app", "show"})
|
||||
if result.Failure == nil {
|
||||
t.Fatal("accepted a child flag before the complete command path")
|
||||
}
|
||||
@@ -55,7 +54,7 @@ func TestRoutingSnapshotPairsParsedKeyWithItsRunner(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
snapshot := app.routeSnapshot()
|
||||
session := internalcobra.Prepare(snapshot.metadata, commandmeta.ParseOptions{Context: context.Background()})
|
||||
session := internalcobra.Prepare(snapshot.metadata, commandmeta.ParseOptions{})
|
||||
parsed := session.Parse([]string{"run"})
|
||||
if parsed.Failure != nil {
|
||||
t.Fatalf("parse failed: %s", parsed.Failure.Message)
|
||||
|
||||
Reference in New Issue
Block a user