#include "components/autofill/core/browser/form_parsing/regex_patterns.h"
#include <string>
#include <string_view>
#include <vector>
#include "base/containers/flat_set.h"
#include "base/logging.h"
#include "base/ranges/ranges.h"
#include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/browser/form_parsing/buildflags.h"
#include "components/autofill/core/browser/form_parsing/regex_patterns_inl.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_regexes.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
Contains;
Each;
ElementsAre;
ElementsAreArray;
IsSupersetOf;
Not;
UnorderedElementsAreArray;
namespace autofill {
class MatchPatternRefTestApi { … };
namespace {
MatchPatternRefTestApi test_api(MatchPatternRef p) { … }
auto Matches(std::u16string_view regex) { … }
auto Matches(MatchingPattern pattern) { … }
auto Matches(MatchPatternRef pattern_ref) { … }
auto MatchesAny(base::span<const MatchPatternRef> pattern_refs) { … }
const auto IsSupplementary = …;
bool IsEmpty(const char* s) { … }
}
bool operator==(MatchPatternRef a, MatchPatternRef b) { … }
bool operator!=(MatchPatternRef a, MatchPatternRef b) { … }
void PrintTo(MatchPatternRef p, std::ostream* os) { … }
class RegexPatternsTest : public testing::TestWithParam<PatternSource> { … };
INSTANTIATE_TEST_SUITE_P(…);
class MatchPatternRefInternalsTest
: public ::testing::TestWithParam<MatchPatternRefTestApi::UnderlyingType> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(MatchPatternRefInternalsTest, MatchPatternRef) { … }
TEST_F(RegexPatternsTest, MatchPatternRefDereference) { … }
TEST_F(RegexPatternsTest, IsSupportedLanguageCode) { … }
TEST_P(RegexPatternsTest, PseudoLanguageIsUnionOfLanguages) { … }
TEST_P(RegexPatternsTest, FallbackToPseudoLanguageIfLanguageDoesNotExist) { … }
TEST_P(RegexPatternsTest,
EnglishPatternsAreAddedToOtherLanguagesAsSupplementaryPatterns) { … }
struct PatternTestCase { … };
class RegexPatternsTestWithSamples
: public testing::TestWithParam<PatternTestCase> { … };
TEST_P(RegexPatternsTestWithSamples, TestPositiveAndNegativeCases) { … }
INSTANTIATE_TEST_SUITE_P(…);
}