#include "components/optimization_guide/core/model_execution/redactor.h"
#include <initializer_list>
#include "base/strings/string_number_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/re2/src/re2/re2.h"
namespace optimization_guide {
RedactBehavior;
Redactor CreateRedactor(std::initializer_list<proto::RedactRule> rules) { … }
proto::RedactRule CreateRule(
const std::string& regex,
RedactBehavior behavior = RedactBehavior::REDACT_IF_ONLY_IN_OUTPUT,
std::optional<std::string> replacement_string = std::nullopt,
std::optional<int> min_pattern_length = std::nullopt,
std::optional<int> max_pattern_length = std::nullopt,
std::optional<int> group = std::nullopt) { … }
TEST(RedactorTest, RedactMultipleHitsNotPresentInInput) { … }
TEST(RedactorTest, RedactMultipleHits) { … }
TEST(RedactorTest, RedactMultipleHitsMultipleRegex) { … }
TEST(RedactorTest, RedactNotAtEnd) { … }
TEST(RedactorTest, RedactAlways) { … }
TEST(RedactorTest, Reject) { … }
TEST(RedactorTest, RedactWithReplacmentText) { … }
TEST(RedactorTest, DontRedactIfMatchTooMuch) { … }
TEST(RedactorTest, DontRedactIfMatchTooLittle) { … }
TEST(RedactorTest, MatchLimits) { … }
TEST(RedactorTest, ReplaceGroup) { … }
TEST(RedactorTest, ReplaceGroup2) { … }
}