Skip to content

Commit 593a891

Browse files
committed
WIP
1 parent a97a7ad commit 593a891

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

pty/pty_other.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,17 @@ func (p *otherPty) Resize(height uint16, width uint16) error {
114114
}
115115

116116
func (p *otherPty) Close() error {
117+
if p.opts.logger != nil {
118+
p.opts.logger.Println("Will close...")
119+
}
120+
117121
p.mutex.Lock()
118122
defer p.mutex.Unlock()
119123

124+
if p.opts.logger != nil {
125+
p.opts.logger.Println("Closing...")
126+
}
127+
120128
if p.closed {
121129
return p.err
122130
}

pty/ptytest/ptytest.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func (p *PTY) ExpectMatch(str string) string {
152152
p.logf("matched %q = %q", str, buffer.String())
153153
return buffer.String()
154154
case <-timeout.Done():
155-
// Ensure gorouine is cleaned up before test exit.
155+
// Ensure goroutine is cleaned up before test exit.
156156
_ = p.out.closeErr(p.Close())
157157
<-match
158158

@@ -202,7 +202,7 @@ func logf(t *testing.T, name, format string, args ...interface{}) {
202202
func fatalf(t *testing.T, name, reason, format string, args ...interface{}) {
203203
t.Helper()
204204

205-
panic(fmt.Sprintf("%s: %s %s", name, reason, fmt.Sprintf(format, args...)))
205+
t.Fatal(fmt.Sprintf("%s: %s %s", name, reason, fmt.Sprintf(format, args...)))
206206
}
207207

208208
// stdbuf is like a buffered stdout, it buffers writes until read.

0 commit comments

Comments
 (0)