Drop the info API tests that tested the control socket's code twice

The endpoint is one type under both servers, so the info API's copies of
the rebind, failed-rebind and cancellation tests ran the control socket's
code a second time, and in-place access changes were pinned twice more.

- info API: the three endpoint tests, the mode test and the wire test's mode step go
- the control socket's group hand-over test stands for both servers
- registry: one Resolve test with both the typed and the worded assertions, in registry_test

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Matt RichardsonandClaude Fable 5.1 committed 2026-10-21 12:26:57 -04:00
1 parent aa04cc446a
commit f2a8883563
4 files changed
+15 -134

No files matched your search

+12 -7
View File
@@ -87,19 +87,24 @@ func TestWithheldIsNotReportedAsUnknown(t *testing.T) {
assert.Contains(t, out.String(), "did not understand: no-such-command")
}
// TestResolveTypesTheWithheldRefusal: a surface with status codes tells a withheld
// command from an unknown one by the error's type, never by asking the unfiltered
// registry, which is the one thing a filtered surface must not consult.
func TestResolveTypesTheWithheldRefusal(t *testing.T) {
// TestResolveTellsUnknownFromWithheld: the two cases read differently to an operator,
// and a surface with status codes tells them apart by the error's type, never by asking
// the unfiltered registry, which is the one thing a filtered surface must not consult.
func TestResolveTellsUnknownFromWithheld(t *testing.T) {
r := testRegistry().Filter(notWithheld, testReason)
_, err := r.Resolve("withheld")
c, err := r.Resolve("served")
require.NoError(t, err)
assert.Equal(t, Name("served"), c.Name)
_, err = r.Resolve("withheld")
var withheld *WithheldError
require.ErrorAs(t, err, &withheld)
assert.Contains(t, err.Error(), testReason)
require.ErrorContains(t, err, "withheld is not available on this surface")
require.ErrorContains(t, err, testReason)
_, err = r.Resolve("no-such-command")
require.Error(t, err)
require.ErrorContains(t, err, `unknown command "no-such-command"`)
assert.NotErrorAs(t, err, &withheld, "an unknown name is not a withheld one")
}
-16
View File
@@ -68,22 +68,6 @@ func TestParseLineCarriesWhatWasSetInParseableForm(t *testing.T) {
assert.Equal(t, paramsSeen{Verbose: true, Wait: 2 * time.Second}, (*seen)[0])
}
// TestResolveTellsUnknownFromWithheld: the two cases read differently to an operator,
// and Resolve is the edge that decides which one a name from the wire is.
func TestResolveTellsUnknownFromWithheld(t *testing.T) {
r := testRegistry().Filter(notWithheld, testReason)
c, err := r.Resolve("served")
require.NoError(t, err)
assert.Equal(t, Name("served"), c.Name)
_, err = r.Resolve("withheld")
require.ErrorContains(t, err, "withheld is not available on this surface")
_, err = r.Resolve("no-such-command")
require.ErrorContains(t, err, `unknown command "no-such-command"`)
}
// TestLineRunsTheFlagSetItParsed: the ssh path hands Run the FlagSet the line was parsed
// into, with no trip through a Request. A flag.Func has no String worth re-parsing, so a
// round trip would hand Run an empty value and no error; the line's value must arrive.