Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions source/common/common/regex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,6 @@ namespace Envoy {
namespace Regex {
namespace {

class CompiledStdMatcher : public CompiledMatcher {
public:
CompiledStdMatcher(std::regex&& regex) : regex_(std::move(regex)) {}

// CompiledMatcher
bool match(absl::string_view value) const override {
try {
return std::regex_match(value.begin(), value.end(), regex_);
} catch (const std::regex_error& e) {
return false;
}
}

// CompiledMatcher
std::string replaceAll(absl::string_view value, absl::string_view substitution) const override {
try {
return std::regex_replace(std::string(value), regex_, std::string(substitution));
} catch (const std::regex_error& e) {
return std::string(value);
}
}

private:
const std::regex regex_;
};

class CompiledGoogleReMatcher : public CompiledMatcher {
public:
CompiledGoogleReMatcher(const envoy::type::matcher::v3::RegexMatcher& config)
Expand Down
8 changes: 8 additions & 0 deletions test/common/common/stl_helpers_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,12 @@ TEST(StlHelpersTest, AccumulateToString) {
[](const int& i) { return std::to_string(i); }));
}

TEST(StlHelpersTest, ContainsReferenceTest) {
std::string str1{"1"};
std::vector<std::reference_wrapper<std::string>> numbers{str1};
EXPECT_TRUE(containsReference(numbers, str1));
std::string str2{"2"};
EXPECT_FALSE(containsReference(numbers, str2));
}

} // namespace Envoy
2 changes: 1 addition & 1 deletion test/per_file_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ declare -a KNOWN_LOW_COVERAGE=(
"source/common:96.3" # Raise when QUIC coverage goes up
"source/common/api:75.3"
"source/common/api/posix:73.9"
"source/common/common:96.2"
"source/common/common:96.3"
"source/common/common/posix:94.1"
"source/common/crypto:0.0"
"source/common/event:94.2" # Emulated edge events guards don't report LCOV
Expand Down