Skip to content

Commit

Permalink
[base] Unified stl_add and stl_helpers.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpimenov authored and vmihaylenko committed Sep 14, 2018
1 parent 4a44e1d commit c7e0965
Show file tree
Hide file tree
Showing 159 changed files with 754 additions and 807 deletions.
1 change: 0 additions & 1 deletion base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ set(
src_point.cpp
src_point.hpp
stats.hpp
stl_add.hpp
stl_helpers.hpp
stl_iterator.hpp
string_format.cpp
Expand Down
3 changes: 1 addition & 2 deletions base/base_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ set(
rolling_hash_test.cpp
scope_guard_test.cpp
small_set_test.cpp
stl_add_test.cpp
stl_helpers_test.cpp
stl_helpers_tests.cpp
string_format_test.cpp
string_utils_test.cpp
suffix_array_tests.cpp
Expand Down
5 changes: 3 additions & 2 deletions base/base_tests/cache_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include "testing/testing.hpp"

#include "base/cache.hpp"
#include "base/macros.hpp"
#include "base/stl_add.hpp"
#include "base/stl_helpers.hpp"

#include <functional>

Expand Down Expand Up @@ -86,7 +87,7 @@ UNIT_TEST(CacheSmoke_0)
cache.Find(0, found);
TEST(!found, ());
std::vector<char> v;
cache.ForEachValue(MakeBackInsertFunctor(v));
cache.ForEachValue(base::MakeBackInsertFunctor(v));
TEST_EQUAL(v, std::vector<char>(8, 0), ());
}

Expand Down
14 changes: 7 additions & 7 deletions base/base_tests/regexp_test.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "testing/testing.hpp"

#include "base/stl_add.hpp"
#include "base/stl_helpers.hpp"
#include "base/string_utils.hpp"

#include <regex>
Expand Down Expand Up @@ -29,7 +29,7 @@ UNIT_TEST(RegExp_ForEachMatched)
{
std::string const s = "6.66, 9.99";
std::vector<std::string> v;
strings::ForEachMatched(s, exp, MakeBackInsertFunctor(v));
strings::ForEachMatched(s, exp, base::MakeBackInsertFunctor(v));
TEST_EQUAL(v.size(), 1, ());
TEST_EQUAL(v[0], s, ());
}
Expand All @@ -38,7 +38,7 @@ UNIT_TEST(RegExp_ForEachMatched)
std::string const s1 = "6.66, 9.99";
std::string const s2 = "-5.55, -7.77";
std::vector<std::string> v;
strings::ForEachMatched(s1 + " 180 , bfuewib 365@" + s2, exp, MakeBackInsertFunctor(v));
strings::ForEachMatched(s1 + " 180 , bfuewib 365@" + s2, exp, base::MakeBackInsertFunctor(v));
TEST_EQUAL(v.size(), 2, ());
TEST_EQUAL(v[0], s1, ());
TEST_EQUAL(v[1], s2, ());
Expand All @@ -47,30 +47,30 @@ UNIT_TEST(RegExp_ForEachMatched)
{
std::string const s = "X6.66, 9.99";
std::vector<std::string> v;
strings::ForEachMatched(s, exp, MakeBackInsertFunctor(v));
strings::ForEachMatched(s, exp, base::MakeBackInsertFunctor(v));
TEST_EQUAL(v.size(), 1, ());
TEST_EQUAL(v[0], std::string(s.begin() + 1, s.end()), ());
}

{
std::string const s = "6.66, 9.99X";
std::vector<std::string> v;
strings::ForEachMatched(s, exp, MakeBackInsertFunctor(v));
strings::ForEachMatched(s, exp, base::MakeBackInsertFunctor(v));
TEST_EQUAL(v.size(), 1, ());
TEST_EQUAL(v[0], std::string(s.begin(), s.end() - 1), ());
}

{
std::string const s = "6.66X, 9.99";
std::vector<std::string> v;
strings::ForEachMatched(s, exp, MakeBackInsertFunctor(v));
strings::ForEachMatched(s, exp, base::MakeBackInsertFunctor(v));
TEST_EQUAL(v.size(), 0, ());
}

{
std::string const s = "6.66, X9.99";
std::vector<std::string> v;
strings::ForEachMatched(s, exp, MakeBackInsertFunctor(v));
strings::ForEachMatched(s, exp, base::MakeBackInsertFunctor(v));
TEST_EQUAL(v.size(), 0, ());
}
}
152 changes: 0 additions & 152 deletions base/base_tests/stl_helpers_test.cpp

This file was deleted.

Loading

0 comments on commit c7e0965

Please sign in to comment.