Skip to content

Commit

Permalink
Add test case for read_line when the line ends with a EOF
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaAmora committed Aug 29, 2024
1 parent 2446f3c commit 74bd796
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/golden_tests/io/eof.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
text
6 changes: 6 additions & 0 deletions tests/golden_tests/io/read_line_eof.bend
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def main:
with IO:
fd <- IO/done_on_err(IO/FS/open("tests/golden_tests/io/eof.txt", "r"))
bytes <- IO/FS/read_line(fd)
txt = String/decode_utf8(bytes)
return wrap(txt)

0 comments on commit 74bd796

Please sign in to comment.