File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -245,3 +245,22 @@ fn get_target_user_dirs() {
245245 other => panic ! ( "target path is not a junction point: {:?}" , other) ,
246246 }
247247}
248+
249+ #[ test]
250+ fn create_with_verbatim_prefix_paths ( ) {
251+ // Regression test for https://github.com/tesuji/junction/issues/30
252+ let tmpdir = create_tempdir ( ) ;
253+
254+ let target = tmpdir. path ( ) . join ( "target" ) ;
255+ let link_parent = tmpdir. path ( ) . join ( "links" ) ;
256+ fs:: create_dir_all ( & target) . unwrap ( ) ;
257+ fs:: create_dir_all ( & link_parent) . unwrap ( ) ;
258+
259+ // std::fs::canonicalize() returns paths with \\?\ verbatim prefix on Windows
260+ let target = fs:: canonicalize ( & target) . unwrap ( ) ;
261+ let junction = fs:: canonicalize ( & link_parent) . unwrap ( ) . join ( "junction" ) ;
262+
263+ super :: create ( & target, & junction) . unwrap ( ) ;
264+ assert ! ( super :: exists( & junction) . unwrap( ) , "junction should exist" ) ;
265+ assert_eq ! ( super :: get_target( & junction) . unwrap( ) , target) ;
266+ }
You can’t perform that action at this time.
0 commit comments