X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/d9fddc0f506eb4ead7049f5638674b2b8773fcaa..8707a09fee94c97e29d668d24fb9713373913e0b:/terminal_client_helper_test.go?ds=inline diff --git a/terminal_client_helper_test.go b/terminal_client_helper_test.go index 0fdd93b..5018e89 100644 --- a/terminal_client_helper_test.go +++ b/terminal_client_helper_test.go @@ -27,11 +27,6 @@ func (c *TerminalTestClient) Type(line string) { } } -// Output returns what the client showed. -func (c *TerminalTestClient) Output() string { - return c.out.String() -} - // WaitFor waits until the client showed text. func (c *TerminalTestClient) WaitFor(t *testing.T, text string) { t.Helper() @@ -41,6 +36,11 @@ func (c *TerminalTestClient) WaitFor(t *testing.T, text string) { }, 10*time.Second, time.Millisecond, "output so far: %q", c.Output()) } +// Output returns what the client showed. +func (c *TerminalTestClient) Output() string { + return c.out.String() +} + // Close ends the input and waits for the client. func (c *TerminalTestClient) Close() error { err := c.input.Close() @@ -70,7 +70,7 @@ func terminalStartTestClient(t *testing.T, socket string) *TerminalTestClient { }() t.Cleanup(func() { - _ = writer.Close() + require.NoError(t, writer.Close()) }) return client