diff options
author | Ilnur Khuziev <ilnur.khuziev@yandex.ru> | 2022-02-10 16:46:14 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:14 +0300 |
commit | 60040c91ffe701a84689b2c6310ff845e65cff42 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/generic/xrange_ut.cpp | |
parent | 736dcd8ca259457a136f2f9f9168c44643914323 (diff) | |
download | ydb-60040c91ffe701a84689b2c6310ff845e65cff42.tar.gz |
Restoring authorship annotation for Ilnur Khuziev <ilnur.khuziev@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic/xrange_ut.cpp')
-rw-r--r-- | util/generic/xrange_ut.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/util/generic/xrange_ut.cpp b/util/generic/xrange_ut.cpp index f8ba3c6f1f..8106da03e7 100644 --- a/util/generic/xrange_ut.cpp +++ b/util/generic/xrange_ut.cpp @@ -3,7 +3,7 @@ #include "algorithm.h" #include "maybe.h" #include "vector.h" -#include <library/cpp/testing/unittest/registar.h> +#include <library/cpp/testing/unittest/registar.h> #include <util/string/builder.h> Y_UNIT_TEST_SUITE(XRange) { @@ -78,40 +78,40 @@ Y_UNIT_TEST_SUITE(XRange) { } UNIT_ASSERT_VALUES_EQUAL(digSumByPtr, digSumExpected); } - + Y_UNIT_TEST(SizeMethodCheck) { - UNIT_ASSERT_VALUES_EQUAL(xrange(5).size(), 5); - UNIT_ASSERT_VALUES_EQUAL(xrange(0, 5, 2).size(), 3); - UNIT_ASSERT_VALUES_EQUAL(xrange(0, 6, 2).size(), 3); - } - + UNIT_ASSERT_VALUES_EQUAL(xrange(5).size(), 5); + UNIT_ASSERT_VALUES_EQUAL(xrange(0, 5, 2).size(), 3); + UNIT_ASSERT_VALUES_EQUAL(xrange(0, 6, 2).size(), 3); + } + class TVectorChild: public TVector<size_t> { - public: + public: template <typename TIterator> TVectorChild(TIterator a, TIterator b) : TVector<size_t>(a, b) { } - }; - + }; + Y_UNIT_TEST(ConvertionWorks) { TVector<size_t> data = {0, 1, 2, 3, 4, 5, 6, 7, 8}; - + TVector<size_t> convertionResults[] = {xrange<size_t>(9), xrange<ui32>(0, 9), xrange(0, 9, 1)}; - - for (const auto& arr : convertionResults) { - UNIT_ASSERT(arr == data); - } - - TVectorChild sons[] = {xrange(0, 9), + + for (const auto& arr : convertionResults) { + UNIT_ASSERT(arr == data); + } + + TVectorChild sons[] = {xrange(0, 9), xrange(0, 9, 1)}; - - for (const auto& arr : sons) { - UNIT_ASSERT(arr == data); - } - } + + for (const auto& arr : sons) { + UNIT_ASSERT(arr == data); + } + } template <class XRangeContainer> void TestEmptyRanges(const XRangeContainer& c) { |