diff options
author | Alexander Fokin <apfokin@gmail.com> | 2022-02-10 16:45:38 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:38 +0300 |
commit | bf9e69a933f89af083d895185f01ed65e4d90766 (patch) | |
tree | b2cc84ee7850122e7ccf51d0ea21e4fa7e7a5685 /util/generic/array_ref_ut.cpp | |
parent | 863a59a65247c24db7cb06789bc5cf79d04da32f (diff) | |
download | ydb-bf9e69a933f89af083d895185f01ed65e4d90766.tar.gz |
Restoring authorship annotation for Alexander Fokin <apfokin@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'util/generic/array_ref_ut.cpp')
-rw-r--r-- | util/generic/array_ref_ut.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/util/generic/array_ref_ut.cpp b/util/generic/array_ref_ut.cpp index c926b55704..4c8eaf7135 100644 --- a/util/generic/array_ref_ut.cpp +++ b/util/generic/array_ref_ut.cpp @@ -168,23 +168,23 @@ Y_UNIT_TEST_SUITE(TestArrayRef) { //Testing if operator== compares values, not pointers UNIT_ASSERT_EQUAL(cRef, bSubRef); } - + Y_UNIT_TEST(TestImplicitConstructionFromContainer) { - /* Just test compilation. */ - auto fc = [](TArrayRef<const int>) {}; - auto fm = [](TArrayRef<int>) {}; - + /* Just test compilation. */ + auto fc = [](TArrayRef<const int>) {}; + auto fm = [](TArrayRef<int>) {}; + fc(TVector<int>({1})); - + const TVector<int> ac = {1}; TVector<int> am = {1}; - - fc(ac); - fc(am); - fm(am); - // fm(ac); // This one shouldn't compile. - } - + + fc(ac); + fc(am); + fm(am); + // fm(ac); // This one shouldn't compile. + } + Y_UNIT_TEST(TestFirstLastSubspan) { const int arr[] = {1, 2, 3, 4, 5}; TArrayRef<const int> aRef(arr); @@ -198,20 +198,20 @@ Y_UNIT_TEST_SUITE(TestArrayRef) { Y_UNIT_TEST(TestSlice) { const int a0[] = {1, 2, 3}; TArrayRef<const int> r0(a0); - TArrayRef<const int> s0 = r0.Slice(2); - - UNIT_ASSERT_VALUES_EQUAL(s0.size(), 1); - UNIT_ASSERT_VALUES_EQUAL(s0[0], 3); - + TArrayRef<const int> s0 = r0.Slice(2); + + UNIT_ASSERT_VALUES_EQUAL(s0.size(), 1); + UNIT_ASSERT_VALUES_EQUAL(s0[0], 3); + const int a1[] = {1, 2, 3, 4}; TArrayRef<const int> r1(a1); - TArrayRef<const int> s1 = r1.Slice(2, 1); - - UNIT_ASSERT_VALUES_EQUAL(s1.size(), 1); - UNIT_ASSERT_VALUES_EQUAL(s1[0], 3); + TArrayRef<const int> s1 = r1.Slice(2, 1); + + UNIT_ASSERT_VALUES_EQUAL(s1.size(), 1); + UNIT_ASSERT_VALUES_EQUAL(s1[0], 3); //FIXME: size checks are implemented via Y_ASSERT, hence there is no way to test them - } + } Y_UNIT_TEST(SubRegion) { TVector<char> x; |