@@ -36,7 +36,7 @@ void test(std::string s, std::string_view sv, sub_string ss, sub_sub_string sss,
3636 string_like sl, string_like_camel slc, prefer_underscore_version puv,
3737 prefer_underscore_version_flip puvf) {
3838 s.find (" a" ) == 0 ;
39- // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of find() == 0
39+ // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of find [modernize-use-starts-ends-with]
4040 // CHECK-FIXES: s.starts_with("a");
4141
4242 (((((s)).find (" a" )))) == ((0 ));
@@ -68,7 +68,7 @@ void test(std::string s, std::string_view sv, sub_string ss, sub_sub_string sss,
6868 // CHECK-FIXES: !s.starts_with("a");
6969
7070 s.rfind (" a" , 0 ) == 0 ;
71- // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of rfind() == 0
71+ // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of rfind [modernize-use-starts-ends-with]
7272 // CHECK-FIXES: s.starts_with("a");
7373
7474 s.rfind (s, 0 ) == 0 ;
@@ -139,11 +139,11 @@ void test(std::string s, std::string_view sv, sub_string ss, sub_sub_string sss,
139139 // CHECK-FIXES: puvf.starts_with("a");
140140
141141 s.compare (0 , 1 , " a" ) == 0 ;
142- // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of compare() == 0
142+ // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of compare [modernize-use-starts-ends-with]
143143 // CHECK-FIXES: s.starts_with("a");
144144
145145 s.compare (0 , 1 , " a" ) != 0 ;
146- // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of compare() != 0
146+ // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of compare [modernize-use-starts-ends-with]
147147 // CHECK-FIXES: !s.starts_with("a");
148148
149149 s.compare (0 , strlen (" a" ), " a" ) == 0 ;
@@ -269,17 +269,17 @@ void test_substr() {
269269
270270 // Basic pattern
271271 str.substr (0 , 5 ) == " hello" ;
272- // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of substr() == [modernize-use-starts-ends-with]
272+ // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of substr [modernize-use-starts-ends-with]
273273 // CHECK-FIXES: str.starts_with("hello");
274274
275275 // With string literal on left side
276276 " hello" == str.substr (0 , 5 );
277- // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of substr() == [modernize-use-starts-ends-with]
277+ // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of substr [modernize-use-starts-ends-with]
278278 // CHECK-FIXES: str.starts_with("hello");
279279
280280 // Inequality comparison
281281 str.substr (0 , 5 ) != " world" ;
282- // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of substr() != [modernize-use-starts-ends-with]
282+ // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of substr [modernize-use-starts-ends-with]
283283 // CHECK-FIXES: !str.starts_with("world");
284284
285285 // Ensure non-zero start position is not transformed
@@ -291,21 +291,21 @@ void test_substr() {
291291
292292 // String literal with size calculation
293293 str.substr (0 , strlen (" hello" )) == " hello" ;
294- // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of substr() == [modernize-use-starts-ends-with]
294+ // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of substr [modernize-use-starts-ends-with]
295295 // CHECK-FIXES: str.starts_with("hello");
296296
297297 str.substr (0 , prefix.size ()) == prefix;
298- // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of substr() == [modernize-use-starts-ends-with]
298+ // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of substr [modernize-use-starts-ends-with]
299299 // CHECK-FIXES: str.starts_with(prefix);
300300
301301 str.substr (0 , prefix.length ()) == prefix;
302- // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of substr() == [modernize-use-starts-ends-with]
302+ // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of substr [modernize-use-starts-ends-with]
303303 // CHECK-FIXES: str.starts_with(prefix);
304304
305305 // Tests to verify macro behavior
306306 #define MSG " hello"
307307 str.substr (0 , strlen (MSG)) == MSG;
308- // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of substr() == [modernize-use-starts-ends-with]
308+ // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with instead of substr [modernize-use-starts-ends-with]
309309 // CHECK-FIXES: str.starts_with(MSG);
310310
311311 #define STARTS_WITH (X, Y ) (X).substr(0 , (Y).size()) == (Y)
0 commit comments