mirror of
https://github.com/danog/file.git
synced 2024-11-30 04:19:39 +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 {
|
} else {
|
||||||
$this->position += \strlen($result);
|
$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->assertSame($position, $handle->tell());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->assertNull(yield $handle->read());
|
||||||
$this->assertSame(yield File\get(__FILE__), $contents);
|
$this->assertSame(yield File\get(__FILE__), $contents);
|
||||||
|
|
||||||
yield $handle->close();
|
yield $handle->close();
|
||||||
|
Loading…
Reference in New Issue
Block a user