File tree Expand file tree Collapse file tree
crates/bough-cli-tests/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,7 +36,14 @@ fn strip_ansi(s: &str) -> String {
3636
3737fn redact ( s : & str , fixture : & Fixture ) -> String {
3838 let stripped = strip_ansi ( s) ;
39- let fixture_path = fixture. path ( ) . to_string_lossy ( ) . into_owned ( ) ;
39+ // On macOS, /var is a symlink to /private/var — canonicalize to match bough output.
40+ // On Windows, canonicalize expands 8.3 short names (RUNNER~1 → runneradmin) which
41+ // diverges from what bough sees via current_dir(), so we skip it.
42+ #[ cfg( unix) ]
43+ let base = fixture. path ( ) . canonicalize ( ) . unwrap_or_else ( |_| fixture. path ( ) . to_path_buf ( ) ) ;
44+ #[ cfg( not( unix) ) ]
45+ let base = fixture. path ( ) . to_path_buf ( ) ;
46+ let fixture_path = base. to_string_lossy ( ) . into_owned ( ) ;
4047 // Generate variants to handle OS path separator differences in output
4148 let tmp_json = fixture_path. replace ( '\\' , "\\ \\ " ) ;
4249 let tmp_fwd = fixture_path. replace ( '\\' , "/" ) ;
You can’t perform that action at this time.
0 commit comments