File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed
crates/turbopack-test-utils/src Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -31,19 +31,22 @@ pub async fn snapshot_issues<
31
31
let expected_issues = expected ( issues_path) . await ?;
32
32
let mut seen = HashSet :: new ( ) ;
33
33
for ( plain_issue, debug_string) in captured_issues. into_iter ( ) {
34
+ let title = plain_issue
35
+ . title
36
+ . replace ( '/' , "__" )
37
+ // We replace "*", "?", and '"' because they're not allowed in filenames on Windows.
38
+ . replace ( '*' , "__star__" )
39
+ . replace ( '"' , "__quo__" )
40
+ . replace ( '?' , "__q__" )
41
+ . replace ( ':' , "__c__" ) ;
42
+ let title = if title. len ( ) > 50 {
43
+ & title[ 0 ..50 ]
44
+ } else {
45
+ & title
46
+ } ;
34
47
let hash = encode_hex ( plain_issue. internal_hash ( true ) ) ;
35
48
36
- let path = issues_path. join ( & format ! (
37
- "{}-{}.txt" ,
38
- plain_issue
39
- . title
40
- . replace( '/' , "__" )
41
- // We replace "*", "?", and '"' because they're not allowed in filenames on Windows.
42
- . replace( '*' , "__star__" )
43
- . replace( '"' , "__quo__" )
44
- . replace( '?' , "__q__" ) ,
45
- & hash[ 0 ..6 ]
46
- ) ) ;
49
+ let path = issues_path. join ( & format ! ( "{title}-{}.txt" , & hash[ 0 ..6 ] ) ) ;
47
50
if !seen. insert ( path) {
48
51
continue ;
49
52
}
You can’t perform that action at this time.
0 commit comments