aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/maybe_ut.cpp
diff options
context:
space:
mode:
authoryuraaka <yuraaka@yandex-team.ru>2022-02-10 16:47:05 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:05 +0300
commit5577dc406121f6fb3f45b227c01f4251880193a1 (patch)
treeb83306b6e37edeea782e9eed673d89286c4fef35 /util/generic/maybe_ut.cpp
parent4230543261d7a38ef4dc14785ae0d45f2da43704 (diff)
downloadydb-5577dc406121f6fb3f45b227c01f4251880193a1.tar.gz
Restoring authorship annotation for <yuraaka@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic/maybe_ut.cpp')
-rw-r--r--util/generic/maybe_ut.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/util/generic/maybe_ut.cpp b/util/generic/maybe_ut.cpp
index 289824521a..2c1a425c5e 100644
--- a/util/generic/maybe_ut.cpp
+++ b/util/generic/maybe_ut.cpp
@@ -208,19 +208,19 @@ Y_UNIT_TEST_SUITE(TMaybeTest) {
TMovable o6 = MakeMaybe<TMovable>(6).GetRef();
UNIT_ASSERT_VALUES_EQUAL(o6.Flag, 6);
}
-
+
Y_UNIT_TEST(TestCast) {
- // Undefined maybe casts to undefined maybe
- TMaybe<short> shortMaybe;
- const auto undefinedMaybe = shortMaybe.Cast<long>();
- UNIT_ASSERT(!undefinedMaybe.Defined());
-
- // Defined maybe casts to defined maybe of another type
- shortMaybe = 34;
- const auto longMaybe = shortMaybe.Cast<long>();
- UNIT_ASSERT(longMaybe.Defined());
- UNIT_ASSERT_VALUES_EQUAL(34, longMaybe.GetRef());
- }
+ // Undefined maybe casts to undefined maybe
+ TMaybe<short> shortMaybe;
+ const auto undefinedMaybe = shortMaybe.Cast<long>();
+ UNIT_ASSERT(!undefinedMaybe.Defined());
+
+ // Defined maybe casts to defined maybe of another type
+ shortMaybe = 34;
+ const auto longMaybe = shortMaybe.Cast<long>();
+ UNIT_ASSERT(longMaybe.Defined());
+ UNIT_ASSERT_VALUES_EQUAL(34, longMaybe.GetRef());
+ }
Y_UNIT_TEST(TestGetOr) {
UNIT_ASSERT_VALUES_EQUAL(TMaybe<TString>().GetOrElse("xxx"), TString("xxx"));