mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Add unit test coverage for ArchiveReaders
This commit is contained in:
parent
eb4ec0e871
commit
1eb4cdf0f8
@ -298,8 +298,6 @@ public:
|
||||
throw Exception(ErrorCodes::UNSUPPORTED_METHOD, "getPosition not supported when reading from archive");
|
||||
}
|
||||
|
||||
off_t getPosition() override { throw Exception(ErrorCodes::UNSUPPORTED_METHOD, "getPosition not supported when reading from archive"); }
|
||||
|
||||
String getFileName() const override { return handle.getFileName(); }
|
||||
|
||||
size_t getFileSize() override { return handle.getFileInfo().uncompressed_size; }
|
||||
|
@ -219,6 +219,10 @@ TEST_P(ArchiveReaderAndWriterTest, TwoFilesInArchive)
|
||||
ASSERT_TRUE(reader->fileExists("a.txt"));
|
||||
ASSERT_TRUE(reader->fileExists("b/c.txt"));
|
||||
|
||||
// Get all files
|
||||
auto files = reader->getAllFiles();
|
||||
EXPECT_EQ(files.size(), 2);
|
||||
|
||||
EXPECT_EQ(reader->getFileInfo("a.txt").uncompressed_size, a_contents.size());
|
||||
EXPECT_EQ(reader->getFileInfo("b/c.txt").uncompressed_size, c_contents.size());
|
||||
|
||||
@ -274,6 +278,10 @@ TEST_P(ArchiveReaderAndWriterTest, TwoFilesInArchive)
|
||||
enumerator = reader->nextFile(std::move(in));
|
||||
EXPECT_EQ(enumerator, nullptr);
|
||||
}
|
||||
|
||||
// Get all files one last time
|
||||
files = reader->getAllFiles();
|
||||
EXPECT_EQ(files.size(), 2);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user