From d029ee761a3847570ad96538ac4c4fc6762303d4 Mon Sep 17 00:00:00 2001 From: mah0x211 Date: Wed, 27 Mar 2024 09:28:38 +0900 Subject: [PATCH] Update test file --- test/reader_test.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/reader_test.lua b/test/reader_test.lua index 4f54377..aac0e1e 100644 --- a/test/reader_test.lua +++ b/test/reader_test.lua @@ -146,7 +146,7 @@ function testcase.read_with_timeout() assert.is_true(t >= .5 and t < .6) -- test that read line from pipe - pw:write('hello\nworld!\n') + pw:write('hello\nio-reader\nworld!\n') s, err, again = r:read() assert.is_nil(err) assert.is_nil(again) @@ -157,6 +157,13 @@ function testcase.read_with_timeout() s, err, again = r:read() assert.is_nil(err) assert.is_nil(again) + assert.equal(s, 'io-reader') + + -- test that read line from pipe even if pipe is closed + pr:close() + s, err, again = r:read() + assert.is_nil(err) + assert.is_nil(again) assert.equal(s, 'world!') -- test that return nil if eof