mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-06 12:17:50 +08:00
fbd86925a9
If the shell outputs more data than can be buffered the test will deadlock. I noticed this when working on issue #661. The tests I was writing would deadlock because a tty can buffer significantly less data than a pipe. Even using a pipe, which typically buffers 8 to 128 KiB, this is theoretically a problem. So use a goroutine to capture the output as it is generated rather than reading it all at once when the test terminates. |
||
---|---|---|
.. | ||
progtest | ||
prog_test.go | ||
prog.go |