@@ -341,8 +341,8 @@ TEST_F(LocalFileIOTest, DeleteFile) {
341341 EXPECT_THAT (del_res, HasErrorMessage (" Cannot delete file" ));
342342}
343343
344- void VerifyReadFullyPreservesPosition (const std::shared_ptr<FileIO>& file_io,
345- const std::string& path) {
344+ void VerifyReadFullyReadsFromAbsolutePosition (const std::shared_ptr<FileIO>& file_io,
345+ const std::string& path) {
346346 ASSERT_THAT (file_io->WriteFile (path, " abcdef" ), IsOk ());
347347
348348 ICEBERG_UNWRAP_OR_FAIL (auto input_file, file_io->NewInputFile (path));
@@ -354,16 +354,23 @@ void VerifyReadFullyPreservesPosition(const std::shared_ptr<FileIO>& file_io,
354354
355355 std::string data (reinterpret_cast <const char *>(buffer.data ()), buffer.size ());
356356 EXPECT_EQ (data, " bc" );
357- EXPECT_THAT (stream->Position (), HasValue (::testing::Eq (5 )));
357+
358+ ASSERT_THAT (stream->Seek (5 ), IsOk ());
359+ std::array<std::byte, 1 > next;
360+ ICEBERG_UNWRAP_OR_FAIL (auto bytes_read, stream->Read (next));
361+ ASSERT_EQ (bytes_read, 1 );
362+ EXPECT_EQ (next[0 ], std::byte{' f' });
358363}
359364
360- TEST_F (LocalFileIOTest, ReadFullyPreservesPosition) {
361- ASSERT_NO_FATAL_FAILURE (VerifyReadFullyPreservesPosition (file_io_, temp_filepath_));
365+ TEST_F (LocalFileIOTest, ReadFullyReadsFromAbsolutePosition) {
366+ ASSERT_NO_FATAL_FAILURE (
367+ VerifyReadFullyReadsFromAbsolutePosition (file_io_, temp_filepath_));
362368}
363369
364- TEST_F (LocalFileIOTest, StdReadFullyPreservesPosition ) {
370+ TEST_F (LocalFileIOTest, StdReadFullyReadsFromAbsolutePosition ) {
365371 auto file_io = std::make_shared<test::StdFileIO>();
366- ASSERT_NO_FATAL_FAILURE (VerifyReadFullyPreservesPosition (file_io, temp_filepath_));
372+ ASSERT_NO_FATAL_FAILURE (
373+ VerifyReadFullyReadsFromAbsolutePosition (file_io, temp_filepath_));
367374}
368375
369376TEST_F (LocalFileIOTest, StdReadKeepsPositionAvailableAtEof) {
0 commit comments