aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/scheme/ut_utils/scheme_ut_utils.cpp
diff options
context:
space:
mode:
authorRuslan Kovalev <ruslan.a.kovalev@gmail.com>2022-02-10 16:46:44 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:44 +0300
commit59e19371de37995fcb36beb16cd6ec030af960bc (patch)
treefa68e36093ebff8b805462e9e6d331fe9d348214 /library/cpp/scheme/ut_utils/scheme_ut_utils.cpp
parent89db6fe2fe2c32d2a832ddfeb04e8d078e301084 (diff)
downloadydb-59e19371de37995fcb36beb16cd6ec030af960bc.tar.gz
Restoring authorship annotation for Ruslan Kovalev <ruslan.a.kovalev@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/scheme/ut_utils/scheme_ut_utils.cpp')
-rw-r--r--library/cpp/scheme/ut_utils/scheme_ut_utils.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/library/cpp/scheme/ut_utils/scheme_ut_utils.cpp b/library/cpp/scheme/ut_utils/scheme_ut_utils.cpp
index 0bbdab10e8..b520eceab5 100644
--- a/library/cpp/scheme/ut_utils/scheme_ut_utils.cpp
+++ b/library/cpp/scheme/ut_utils/scheme_ut_utils.cpp
@@ -1,44 +1,44 @@
-#include "scheme_ut_utils.h"
-
+#include "scheme_ut_utils.h"
+
#include <library/cpp/colorizer/colors.h>
-
-#include <util/stream/str.h>
-
-namespace NSc {
- namespace NUt {
- NSc::TValue AssertFromJson(TStringBuf val) {
- try {
- return TValue::FromJsonThrow(val);
- } catch (const TSchemeParseException& e) {
- TStringStream s;
- NColorizer::TColors colors;
+
+#include <util/stream/str.h>
+
+namespace NSc {
+ namespace NUt {
+ NSc::TValue AssertFromJson(TStringBuf val) {
+ try {
+ return TValue::FromJsonThrow(val);
+ } catch (const TSchemeParseException& e) {
+ TStringStream s;
+ NColorizer::TColors colors;
s << "\n"
<< colors.YellowColor() << "Reason:" << colors.OldColor() << "\n"
<< e.Reason;
s << "\n"
<< colors.YellowColor() << "Where:" << colors.OldColor() << "\n"
<< val.SubStr(0, e.Offset) << colors.RedColor() << val.SubStr(e.Offset) << colors.OldColor() << "\n";
- UNIT_FAIL_IMPL("could not parse json", s.Str());
- return NSc::Null();
- } catch (const yexception& e) {
- TStringStream s;
+ UNIT_FAIL_IMPL("could not parse json", s.Str());
+ return NSc::Null();
+ } catch (const yexception& e) {
+ TStringStream s;
s << '\n'
<< val;
- UNIT_FAIL_IMPL("could not parse json", s.Str());
- return NSc::Null();
- }
- }
-
- void AssertScheme(const TValue& expected, const TValue& actual) {
- UNIT_ASSERT_JSON_EQ_JSON(actual, expected);
- }
-
- void AssertSchemeJson(TStringBuf expected, const NSc::TValue& actual) {
- UNIT_ASSERT_JSON_EQ_JSON(actual, expected);
- }
-
- void AssertJsonJson(TStringBuf expected, TStringBuf actual) {
- UNIT_ASSERT_JSON_EQ_JSON(actual, expected);
- }
- }
-}
+ UNIT_FAIL_IMPL("could not parse json", s.Str());
+ return NSc::Null();
+ }
+ }
+
+ void AssertScheme(const TValue& expected, const TValue& actual) {
+ UNIT_ASSERT_JSON_EQ_JSON(actual, expected);
+ }
+
+ void AssertSchemeJson(TStringBuf expected, const NSc::TValue& actual) {
+ UNIT_ASSERT_JSON_EQ_JSON(actual, expected);
+ }
+
+ void AssertJsonJson(TStringBuf expected, TStringBuf actual) {
+ UNIT_ASSERT_JSON_EQ_JSON(actual, expected);
+ }
+ }
+}