diff options
author | thegeorg <thegeorg@yandex-team.ru> | 2022-02-10 16:45:12 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:12 +0300 |
commit | 49116032d905455a7b1c994e4a696afc885c1e71 (patch) | |
tree | be835aa92c6248212e705f25388ebafcf84bc7a1 /library/cpp/yson | |
parent | 4e839db24a3bbc9f1c610c43d6faaaa99824dcca (diff) | |
download | ydb-49116032d905455a7b1c994e4a696afc885c1e71.tar.gz |
Restoring authorship annotation for <thegeorg@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/yson')
-rw-r--r-- | library/cpp/yson/node/node.cpp | 10 | ||||
-rw-r--r-- | library/cpp/yson/node/node.h | 4 | ||||
-rw-r--r-- | library/cpp/yson/node/node_ut.cpp | 44 | ||||
-rw-r--r-- | library/cpp/yson/token.cpp | 2 |
4 files changed, 30 insertions, 30 deletions
diff --git a/library/cpp/yson/node/node.cpp b/library/cpp/yson/node/node.cpp index 06a09dc180..b39e070718 100644 --- a/library/cpp/yson/node/node.cpp +++ b/library/cpp/yson/node/node.cpp @@ -244,11 +244,11 @@ bool TNode::IsUndefined() const return std::holds_alternative<TUndefined>(Value_); } -bool TNode::HasValue() const -{ - return !IsNull() && !IsUndefined(); -} - +bool TNode::HasValue() const +{ + return !IsNull() && !IsUndefined(); +} + bool TNode::Empty() const { switch (GetType()) { diff --git a/library/cpp/yson/node/node.h b/library/cpp/yson/node/node.h index af12166cc2..5f90f95df0 100644 --- a/library/cpp/yson/node/node.h +++ b/library/cpp/yson/node/node.h @@ -125,8 +125,8 @@ public: bool IsEntity() const; bool IsNull() const; bool IsUndefined() const; - // Returns true if TNode is neither Null, nor Undefined - bool HasValue() const; + // Returns true if TNode is neither Null, nor Undefined + bool HasValue() const; template<typename T> bool IsOfType() const noexcept; diff --git a/library/cpp/yson/node/node_ut.cpp b/library/cpp/yson/node/node_ut.cpp index 1e72d96d8e..448e99f575 100644 --- a/library/cpp/yson/node/node_ut.cpp +++ b/library/cpp/yson/node/node_ut.cpp @@ -50,28 +50,28 @@ Y_UNIT_TEST_SUITE(YtNodeTest) { UNIT_ASSERT(nodeEntity.IsEntity()); } - Y_UNIT_TEST(TestPredicates) { - const TNode undefinedNode; - UNIT_ASSERT(undefinedNode.IsUndefined()); - UNIT_ASSERT(!undefinedNode.IsNull()); - UNIT_ASSERT(!undefinedNode.HasValue()); - - const TNode nullNode = TNode::CreateEntity(); - UNIT_ASSERT(!nullNode.IsUndefined()); - UNIT_ASSERT(nullNode.IsNull()); - UNIT_ASSERT(!nullNode.HasValue()); - - const TNode intNode(int(64)); - UNIT_ASSERT(!intNode.IsUndefined()); - UNIT_ASSERT(!intNode.IsNull()); - UNIT_ASSERT(intNode.HasValue()); - - const TNode stringNode("blah"); - UNIT_ASSERT(!stringNode.IsUndefined()); - UNIT_ASSERT(!stringNode.IsNull()); - UNIT_ASSERT(stringNode.HasValue()); - } - + Y_UNIT_TEST(TestPredicates) { + const TNode undefinedNode; + UNIT_ASSERT(undefinedNode.IsUndefined()); + UNIT_ASSERT(!undefinedNode.IsNull()); + UNIT_ASSERT(!undefinedNode.HasValue()); + + const TNode nullNode = TNode::CreateEntity(); + UNIT_ASSERT(!nullNode.IsUndefined()); + UNIT_ASSERT(nullNode.IsNull()); + UNIT_ASSERT(!nullNode.HasValue()); + + const TNode intNode(int(64)); + UNIT_ASSERT(!intNode.IsUndefined()); + UNIT_ASSERT(!intNode.IsNull()); + UNIT_ASSERT(intNode.HasValue()); + + const TNode stringNode("blah"); + UNIT_ASSERT(!stringNode.IsUndefined()); + UNIT_ASSERT(!stringNode.IsNull()); + UNIT_ASSERT(stringNode.HasValue()); + } + Y_UNIT_TEST(TestComplexConstructors) { const TNode listNode = TNode::CreateList({"one", 2, "tree"}); const auto expectedListValue = std::vector<TNode>({"one", 2, "tree"}); diff --git a/library/cpp/yson/token.cpp b/library/cpp/yson/token.cpp index d74a1f2f1d..c8584c8c2e 100644 --- a/library/cpp/yson/token.cpp +++ b/library/cpp/yson/token.cpp @@ -77,7 +77,7 @@ namespace NYson { } TString TokenTypeToString(ETokenType type) { - return TString(1, TokenTypeToChar(type)); + return TString(1, TokenTypeToChar(type)); } //////////////////////////////////////////////////////////////////////////////// |