aboutsummaryrefslogtreecommitdiffstats
path: root/yt
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2023-11-01 20:31:29 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2023-11-01 20:42:15 +0300
commitbf9ca672c8b62a183d118d591d3415e4276d5421 (patch)
treecdbe36a0af7af94548f54538939fe597e95821ca /yt
parent0e41ec2b5cb2e914863a0514e0b48ffc6c821496 (diff)
downloadydb-bf9ca672c8b62a183d118d591d3415e4276d5421.tar.gz
Intermediate changes
Diffstat (limited to 'yt')
-rw-r--r--yt/yt/core/misc/unittests/error_ut.cpp17
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");