Home | History | Annotate | Download | only in autofill

Lines Matching refs:Match

12 TEST(FormFieldTest, Match) {
15 // Empty strings match.
16 EXPECT_TRUE(FormField::Match(&field, string16(), true));
20 EXPECT_TRUE(FormField::Match(&field, string16(), true));
24 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("^$"), true));
26 // Strictly empty pattern does not match non-empty string.
28 EXPECT_FALSE(FormField::Match(&field, ASCIIToUTF16("^$"), true));
30 // Non-empty pattern doesn't match empty string.
32 EXPECT_FALSE(FormField::Match(&field, ASCIIToUTF16("a"), true));
36 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("^head"), true));
37 EXPECT_FALSE(FormField::Match(&field, ASCIIToUTF16("^tail"), true));
41 EXPECT_FALSE(FormField::Match(&field, ASCIIToUTF16("head$"), true));
42 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("tail$"), true));
46 EXPECT_FALSE(FormField::Match(&field, ASCIIToUTF16("^head$"), true));
47 EXPECT_FALSE(FormField::Match(&field, ASCIIToUTF16("^tail$"), true));
48 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("^head_tail$"), true));
53 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("m.i."), true));
54 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("m\\.i\\."), true));
56 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("m.i."), true));
57 EXPECT_FALSE(FormField::Match(&field, ASCIIToUTF16("m\\.i\\."), true));
61 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("head.*tail"), true));
63 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("head.*tail"), true));
65 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("head.*tail"), true));
67 EXPECT_FALSE(FormField::Match(&field, ASCIIToUTF16("head.+tail"), true));
69 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("head.+tail"), true));
71 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("head.+tail"), true));
75 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("head|other"), true));
76 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("tail|other"), true));
77 EXPECT_FALSE(FormField::Match(&field, ASCIIToUTF16("bad|good"), true));
81 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("head_tail"), true));