Skip to content

Commit

Permalink
Update test file
Browse files Browse the repository at this point in the history
  • Loading branch information
mah0x211 committed Mar 27, 2024
1 parent 83dfe36 commit d029ee7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/reader_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit d029ee7

Please sign in to comment.