#pragma once #ifndef YT_UNITTEST_LIB_H_ #error "Direct inclusion of this file is not allowed, use yt_unittest_lib.h" #endif #undef YT_UNITTEST_LIB_H_ #include namespace NYT::NTesting { //////////////////////////////////////////////////////////////////////////////// template TVector ReadProtoTable(const IClientBasePtr& client, const TString& tablePath) { TVector result; auto reader = client->CreateTableReader(tablePath); for (; reader->IsValid(); reader->Next()) { result.push_back(reader->GetRow()); } return result; } template void WriteProtoTable(const IClientBasePtr& client, const TString& tablePath, const std::vector& rowList) { auto writer = client->CreateTableWriter(tablePath); for (const auto& row : rowList) { writer->AddRow(row); } writer->Finish(); } //////////////////////////////////////////////////////////////////////////////// } // namespace NYT::Testing