MCPcopy Create free account
hub / github.com/bytedance/bolt / TEST_F

Function TEST_F

bolt/functions/prestosql/tests/StringToMapTest.cpp:73–176  ·  view source on GitHub ↗

occurrence >= 20 '"\\}' ',\\s*' '\073' '"}' '\ ' '\\\.' '"}' '\_' '\&\&' '[|]' '|' '[\.]' '[' ',|,' '\\\001' '\\\|' '\/' '\\\$' '\\[|,' '/\+' '],'

Source from the content-addressed store, hash-verified

71// '/\+'
72// '],'
73TEST_F(StringToMapTest, checkRegexPattern) {
74 std::vector<std::tuple<std::string, std::string, bool>> tests{
75 {"\\}", "}", false},
76 {",\\s*", ",\\s*", true},
77 {"\073", "\073", false},
78 {"\"}", "\"}", false},
79 {"\"}", "\"}", false},
80 {"[|]", "[|]", true},
81 {"|", "|", true},
82 {",|,", ",|,", true},
83 {"\\\001", "\\001", true},
84 {"\\[|,", "\\[|,", true},
85 {"],", "],", true},
86 {"\\{", "{", false},
87 {"\\}", "}", false},
88 {"$_$", "$_$", true},
89 {"},", "},", false},
90 {"(", "(", false},
91 {")", ")", false},
92 {"}\\{", "}{", false},
93 {"abc", "abc", false},
94 {"a\\*c", "a*c", false},
95 {"a\\xc", "a\\xc", true}, // illegal \\x
96 {"a*c", "a*c", true},
97 {"\\*\\+\\?", "*+?", false},
98 {"a\\*b\\xc", "a\\*b\\xc", true}, // illegal \\x
99 {"abc字母", "abc字母", false},
100 {"\\^\\.\\$\\*\\+\\?\\(\\)\\[\\]\\{\\}\\|", "^.$*+?()[]{}|", false},
101 {"\\\\", "\\", false},
102 {"\\|\\|", "||", false},
103 {"a\\\\*b", "a\\\\*b", true},
104 {"\\.", ".", false},
105 {"\\*", "*", false},
106 {"\\+", "+", false},
107 {"\\?", "?", false},
108 {"\\(", "(", false},
109 {"\\)", ")", false},
110 {"\\[", "[", false},
111 {"\\]", "]", false},
112 {"\\{", "{", false},
113 {"\\}", "}", false},
114 {"\\|", "|", false},
115 {"\\^", "^", false},
116 {"\\$", "$", false},
117 {"a\\.b", "a.b", false},
118 {"a\\*b", "a*b", false},
119 {"a\\xb", "a\\xb", true},
120 {"", "", false},
121 {"\x22", "\x22", false},
122 {"a.b", "a.b", true},
123 {"a*b", "a*b", true},
124 {"\\.\\*", ".*", false},
125 {"a\\\\b", "a\\b", false},
126 {"a\\b", "a\\b", true},
127 {"a.", "a.", true},
128 {"'a'", "'a'", false},
129 {"\"a\"", "\"a\"", false},
130 {"a b", "a b", false},

Callers

nothing calls this directly

Calls 4

checkRegexPatternFunction · 0.85
assertEqualVectorsFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected