normalizefs 0.0.11

Normalization of file system paths
Documentation
use std::path::Path;
use super::join_windows;


//   join Windows paths tests

fn join(path1: impl AsRef<Path>, path2: impl AsRef<Path>) -> String {
   join_windows(path1, path2).to_str().unwrap().to_owned()
}

#[test]
fn join_plain_names() {
   assert_eq!(join("here","man"), r"here\man");
}

#[test]
fn join_root() {
   assert_eq!(join("/root","man"), r"\root\man");
}

#[test]
fn join_root_with_drive() {
   assert_eq!(join("c:/root","man"), r"C:\root\man");
}

#[test]
fn second_have_updir() {
   assert_eq!(join("here","../man"), "man");
}

#[test]
fn both_empty() {
   assert_eq!(join("",""), "");
}

#[test]
fn second_empty() {
   assert_eq!(join("first",""), "first");
}

#[test]
fn second_dot() {
   assert_eq!(join("first","."), r"first\");
}

#[test]
fn second_empty_result_normalized() {
   assert_eq!(join("././first",""), "first");
}

#[test]
fn absolute_second_slash() {
   assert_eq!(join("something","/root"), r"\root");
}

#[test]
fn absolute_second_backslash() {
   assert_eq!(join("something",r"\root"), r"\root");
}

#[test]
fn absolute_driveless_both_slash() {
   assert_eq!(join("/first","/second"), r"\second");
}

#[test]
fn absolute_joins_drive() {
   assert_eq!(join(r"f:\orig\net","/over"), r"f:\over");
}

#[test]
fn absolute_joins_drive_relative() {
   assert_eq!(join(r"f:orig\net","/over"), r"f:\over");
}

#[test]
fn drive_relative_joining_absolute() {
   assert_eq!(join(r"f:\orig\net","d:slow"), r"f:\orig\net\slow");
}

#[test]
fn absolute_driveless_both_with_backslash() {
   assert_eq!(join(r"\first",r"\second"), r"\second");
}

#[test]
fn normalized_relative_from_curdir_test() {
   assert_eq!(join("././here","././we"), r"here\we");
}