hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 3b6e04558ea9ebb460a7437972b5a6cfa2eb8ca7
parent cc6a9d801f74494b4b6c012dc4760c5ffcb73642
Author: Drew DeVault <sir@cmpwn.com>
Date:   Thu, 30 May 2024 11:07:29 +0200

unix::tty: use bufio::scanner for +test

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Munix/tty/pty_test.ha | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/unix/tty/pty_test.ha b/unix/tty/pty_test.ha @@ -24,7 +24,9 @@ use strings; }; fmt::fprintln(pty.0, "hello, world")!; - let s = strings::fromutf8(bufio::read_line(pty.1) as []u8)!; - defer free(s); + const scan = bufio::newscanner(pty.1); + defer bufio::finish(&scan); + + const s = bufio::scan_line(&scan) as const str; assert(s == "hello, world"); };