diff --git a/tests/golden_tests/io/eof.txt b/tests/golden_tests/io/eof.txt new file mode 100644 index 000000000..f3a34851d --- /dev/null +++ b/tests/golden_tests/io/eof.txt @@ -0,0 +1 @@ +text \ No newline at end of file diff --git a/tests/golden_tests/io/read_line_eof.bend b/tests/golden_tests/io/read_line_eof.bend new file mode 100644 index 000000000..877b63308 --- /dev/null +++ b/tests/golden_tests/io/read_line_eof.bend @@ -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)