yson_ut.cpp 485 B

123456789101112131415161718192021
  1. #include <library/cpp/yson/parser.h>
  2. #include <library/cpp/yson/writer.h>
  3. #include <library/cpp/testing/gtest/gtest.h>
  4. #include <util/stream/mem.h>
  5. using namespace NYson;
  6. TEST(TTestYson, YT_17658)
  7. {
  8. const auto data = TStringBuf{"\x01\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc"};
  9. auto input = TMemoryInput{data};
  10. TStringStream out;
  11. {
  12. TYsonWriter writer(&out, EYsonFormat::Text);
  13. EXPECT_THROW(ParseYsonStringBuffer(data, &writer), std::exception);
  14. }
  15. }