mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
feat: memory_istream seek support
This commit is contained in:
parent
07702f9e57
commit
ce0f90d21e
2 changed files with 62 additions and 1 deletions
|
|
@ -16,4 +16,15 @@ TEST(io, memory_istream) {
|
|||
ASSERT_EQ(text, std::string(data));
|
||||
stream.read(text.data(), 1);
|
||||
ASSERT_TRUE(stream.eof());
|
||||
|
||||
// seek
|
||||
stream.clear();
|
||||
stream.seekg(0);
|
||||
ASSERT_TRUE(stream.good());
|
||||
stream.read(text.data(), n);
|
||||
ASSERT_EQ(text, std::string(data));
|
||||
stream.seekg(-6, std::ios_base::cur);
|
||||
ASSERT_TRUE(stream.good());
|
||||
stream.read(text.data(), 6);
|
||||
ASSERT_EQ(text.substr(0, 6), "world!");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue