]> git.giacomolli.uk - onechat/blobdiff - terminal_client_helper_test.go
Submit root events through the local socket
[onechat] / terminal_client_helper_test.go
index 0fdd93bee91b8b7b9e4fc86e776dcfcc2a632064..5018e89684d3fa4e1d5bf929a1b8b9286cf5276e 100644 (file)
@@ -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