diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2023-11-01 20:31:29 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2023-11-01 20:42:15 +0300 |
commit | bf9ca672c8b62a183d118d591d3415e4276d5421 (patch) | |
tree | cdbe36a0af7af94548f54538939fe597e95821ca | |
parent | 0e41ec2b5cb2e914863a0514e0b48ffc6c821496 (diff) | |
download | ydb-bf9ca672c8b62a183d118d591d3415e4276d5421.tar.gz |
Intermediate changes
-rw-r--r-- | yt/yt/core/misc/unittests/error_ut.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/yt/yt/core/misc/unittests/error_ut.cpp b/yt/yt/core/misc/unittests/error_ut.cpp index 8f3e07476e..2ec50a10c5 100644 --- a/yt/yt/core/misc/unittests/error_ut.cpp +++ b/yt/yt/core/misc/unittests/error_ut.cpp @@ -147,6 +147,23 @@ TEST(TErrorTest, TruncateLargeRValue) EXPECT_EQ("Fourth inn...<message truncated>", truncatedError.InnerErrors()[2].GetMessage()); } +TEST(TErrorTest, TruncateConsistentOverloads) +{ + auto error = TError("Some long long error") + << TError("First inner error") + << TError("Second inner error") + << TError("Third inner error") + << TError("Fourth inner error"); + error.MutableAttributes()->Set("my_attr", "Some long long attr"); + + auto errorCopy = error; + auto truncatedRValueError = std::move(errorCopy).Truncate(/*maxInnerErrorCount*/ 3, /*stringLimit*/ 10); + + auto trunactedLValueError = error.Truncate(/*maxInnerErrorCount*/ 3, /*stringLimit*/ 10); + + EXPECT_EQ(truncatedRValueError, trunactedLValueError); +} + TEST(TErrorTest, TruncateWhitelist) { auto error = TError("Some error"); |