aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/algorithm_ut.cpp
diff options
context:
space:
mode:
authorswarmer <swarmer@yandex-team.ru>2022-06-02 01:34:52 +0300
committerswarmer <swarmer@yandex-team.ru>2022-06-02 01:34:52 +0300
commitdec29e24bcc1d4208ad6f72e60c5b70037a4748d (patch)
treeaf1575eae3f3b2b78f0f657e69a2e8244f2df390 /util/generic/algorithm_ut.cpp
parente673b301b03ea16c0bdc9537de9501f1c9b4cf28 (diff)
downloadydb-dec29e24bcc1d4208ad6f72e60c5b70037a4748d.tar.gz
[util] IsSortedBy for containers
ref:6c01516241e312227b7654b6b0260add648c8609
Diffstat (limited to 'util/generic/algorithm_ut.cpp')
-rw-r--r--util/generic/algorithm_ut.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/util/generic/algorithm_ut.cpp b/util/generic/algorithm_ut.cpp
index 8d732fcc0c..72b326ebbe 100644
--- a/util/generic/algorithm_ut.cpp
+++ b/util/generic/algorithm_ut.cpp
@@ -434,15 +434,19 @@ Y_UNIT_TEST_SUITE(TAlgorithm) {
Y_UNIT_TEST(IsSortedByTest) {
TVector<int> v0;
UNIT_ASSERT_VALUES_EQUAL(IsSortedBy(v0.begin(), v0.end(), std::negate<int>()), true);
+ UNIT_ASSERT_VALUES_EQUAL(IsSortedBy(v0, std::negate<int>()), true);
TVector<int> v1 = {1};
UNIT_ASSERT_VALUES_EQUAL(IsSortedBy(v1.begin(), v1.end(), std::negate<int>()), true);
+ UNIT_ASSERT_VALUES_EQUAL(IsSortedBy(v1, std::negate<int>()), true);
TVector<int> v2 = {8, 7, 6, 6, 5, 5, 5, 4, 3, 2, 1};
UNIT_ASSERT_VALUES_EQUAL(IsSortedBy(v2.begin(), v2.end(), std::negate<int>()), true);
+ UNIT_ASSERT_VALUES_EQUAL(IsSortedBy(v2, std::negate<int>()), true);
TVector<int> v3 = {1, 2, 1};
UNIT_ASSERT_VALUES_EQUAL(IsSortedBy(v3.begin(), v3.end(), std::negate<int>()), false);
+ UNIT_ASSERT_VALUES_EQUAL(IsSortedBy(v3, std::negate<int>()), false);
}
Y_UNIT_TEST(SortTestTwoIterators) {