diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-11-15 18:26:27 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-11-15 18:37:39 +0300 |
commit | 1880fe32503d1703d735fc22de65ad2e2a5ef7f1 (patch) | |
tree | 507fb3ded3ed7f57f181a9f6e5513b5033dd27d6 | |
parent | fac73483a61e24ad7cae8c9eae02e23e10a862e9 (diff) | |
download | ydb-1880fe32503d1703d735fc22de65ad2e2a5ef7f1.tar.gz |
Intermediate changes
commit_hash:a6a45dae782d717c6deaac6a872c24c593927350
-rw-r--r-- | yt/yt/core/yson/unittests/yson_writer_ut.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/yt/yt/core/yson/unittests/yson_writer_ut.cpp b/yt/yt/core/yson/unittests/yson_writer_ut.cpp index 99414f0d94..118781fd44 100644 --- a/yt/yt/core/yson/unittests/yson_writer_ut.cpp +++ b/yt/yt/core/yson/unittests/yson_writer_ut.cpp @@ -6,6 +6,9 @@ #include <yt/yt/core/yson/parser.h> #include <yt/yt/core/yson/stream.h> +#include <yt/yt/core/ytree/ephemeral_node_factory.h> +#include <yt/yt/core/ytree/tree_builder.h> + #include <util/string/escape.h> namespace NYT::NYson { @@ -457,5 +460,20 @@ TEST(TYsonFragmentWriterTest, NoFirstIndent) //////////////////////////////////////////////////////////////////////////////// +TEST(TYsonTreeBuilderTest, MaxListSize) +{ + TString input = + "\"a1\" = {\n" + " \"key\" = 42;\n" + "};\n"; + + auto builder = NYTree::CreateBuilderFromFactory(NYTree::GetEphemeralNodeFactory(), /*treeSizeLimit*/ 0); + builder->BeginTree(); + TStringStream stream(input); + EXPECT_THROW(ParseYson(TYsonInput(&stream), builder.get()), std::exception); +} + +//////////////////////////////////////////////////////////////////////////////// + } // namespace } // namespace NYT::NYson |