1
1
mirror of https://github.com/walles/moar.git synced 2024-09-21 09:01:30 +03:00

Fix a broken test

This commit is contained in:
Johan Walles 2021-01-10 08:42:34 +01:00
parent 54935615ed
commit 2b12953600

View File

@ -201,11 +201,15 @@ func newReaderFromStream(reader io.Reader, fromFilter *exec.Cmd) *Reader {
// Moar in the bottom left corner of the screen.
func NewReaderFromText(name string, text string) *Reader {
noExternalNewlines := strings.Trim(text, "\n")
lines := []string{}
if len(noExternalNewlines) > 0 {
lines = strings.Split(noExternalNewlines, "\n")
}
done := make(chan bool, 1)
done <- true
return &Reader{
name: &name,
lines: strings.Split(noExternalNewlines, "\n"),
lines: lines,
lock: &sync.Mutex{},
done: done,
}