Share the ADMIN text and KILL reason, and test the review's gaps
check / check (push) Waiting to run
check / check (push) Waiting to run
ADMIN's location and email lines come from service.AdminLines, and KillUser applies the default reason, so both transports send the same reply. The Disconnect test now allows a quarter of one write window, so a Disconnect that writes before returning fails it. QueryUserMode and UserhostReply are tested with a read that fails. The handler tests again cover USERHOST for a nick with no session, MODE +o on your own nick, and the status of a successful KILL. handleMode's comment says what it does. Model: opus-5-5
This commit is contained in:
@@ -90,6 +90,16 @@ func TestUserhost(t *testing.T) {
|
||||
t.Errorf("expected alice and bob, got %q", body)
|
||||
}
|
||||
|
||||
msgs, lastID = sendAndPoll(tserver, token, lastID, map[string]any{
|
||||
commandKey: irc.CmdUserhost,
|
||||
bodyKey: []string{"ghost"},
|
||||
})
|
||||
|
||||
body = numericBody(t, msgs, "302")
|
||||
if body != "" {
|
||||
t.Errorf("expected an empty reply for ghost, got %q", body)
|
||||
}
|
||||
|
||||
msgs, _ = sendAndPoll(tserver, token, lastID, map[string]any{
|
||||
commandKey: irc.CmdUserhost,
|
||||
})
|
||||
@@ -187,8 +197,8 @@ func TestKill(t *testing.T) {
|
||||
commandKey: irc.CmdKill,
|
||||
bodyKey: []string{"victim", "go away"},
|
||||
})
|
||||
if status != http.StatusOK {
|
||||
t.Fatalf("expected 200, got %d: %v", status, result)
|
||||
if status != http.StatusOK || result[statusKey] != "ok" {
|
||||
t.Fatalf("expected 200 and status ok, got %d: %v", status, result)
|
||||
}
|
||||
|
||||
msgs, _ = tserver.pollMessages(observerToken, observerLastID)
|
||||
@@ -283,6 +293,7 @@ func TestUserMode(t *testing.T) {
|
||||
{nick, "", "221", "+w"},
|
||||
{strings.ToUpper(nick), "-w", "221", "+"},
|
||||
{nick, "+z", "501", ""},
|
||||
{nick, "+o", "501", ""},
|
||||
{other, "", "502", ""},
|
||||
{other, "-w", "502", ""},
|
||||
} {
|
||||
|
||||
Reference in New Issue
Block a user