mirror of
https://github.com/danog/file.git
synced 2024-11-26 20:04:51 +01:00
Ensure reads resolve to null on EOF, fixes #13
This commit is contained in:
parent
dd64670987
commit
4cccc8d0f7
@ -66,7 +66,7 @@ class EioHandle implements Handle {
|
||||
));
|
||||
} else {
|
||||
$this->position += \strlen($result);
|
||||
$deferred->resolve($result);
|
||||
$deferred->resolve(\strlen($result) ? $result : null);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,6 +53,7 @@ abstract class HandleTest extends TestCase {
|
||||
$this->assertSame($position, $handle->tell());
|
||||
}
|
||||
|
||||
$this->assertNull(yield $handle->read());
|
||||
$this->assertSame(yield File\get(__FILE__), $contents);
|
||||
|
||||
yield $handle->close();
|
||||
|
Loading…
Reference in New Issue
Block a user