File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -290,3 +290,33 @@ fn get_code_blocks() -> Vec<ConfigCodeBlock> {
290
290
291
291
code_blocks
292
292
}
293
+
294
+ #[ test]
295
+ fn check_unstable_option_tracking_issue_numbers ( ) {
296
+ // Ensure that tracking issue links point to the correct issue number
297
+ let tracking_issue =
298
+ regex:: Regex :: new ( r"\(tracking issue: \[#(?P<number>\d+)\]\((?P<link>\S+)\)\)" )
299
+ . expect ( "failed creating configuration pattern" ) ;
300
+
301
+ let lines = BufReader :: new (
302
+ fs:: File :: open ( Path :: new ( CONFIGURATIONS_FILE_NAME ) )
303
+ . unwrap_or_else ( |_| panic ! ( "couldn't read file {}" , CONFIGURATIONS_FILE_NAME ) ) ,
304
+ )
305
+ . lines ( )
306
+ . map ( Result :: unwrap)
307
+ . enumerate ( ) ;
308
+
309
+ for ( idx, line) in lines {
310
+ if let Some ( capture) = tracking_issue. captures ( & line) {
311
+ let number = capture. name ( "number" ) . unwrap ( ) . as_str ( ) ;
312
+ let link = capture. name ( "link" ) . unwrap ( ) . as_str ( ) ;
313
+ assert ! (
314
+ link. ends_with( number) ,
315
+ "{} on line {} does not point to issue #{}" ,
316
+ link,
317
+ idx + 1 ,
318
+ number,
319
+ ) ;
320
+ }
321
+ }
322
+ }
You can’t perform that action at this time.
0 commit comments