ref_ut.cpp 623 B

12345678910111213141516171819202122
  1. #include <library/cpp/testing/gtest/gtest.h>
  2. #include <library/cpp/testing/gtest_extensions/assertions.h>
  3. #include <library/cpp/yt/memory/ref.h>
  4. namespace NYT::NYson {
  5. namespace {
  6. ////////////////////////////////////////////////////////////////////////////////
  7. TEST(TSharedRefTest, Save)
  8. {
  9. const TSharedRef expected = TSharedRef::FromString("My tests data");
  10. TStringStream s;
  11. ::Save(&s, expected); // only Save supported for TSharedRef. You can ::Load serialized data to vector.
  12. }
  13. ////////////////////////////////////////////////////////////////////////////////
  14. } // namespace
  15. } // namespace NYT::NYson