normalizefs 0.0.11

Normalization of file system paths
Documentation
use super::pathconv::path_to_vector as to_vector;
use super::unc_remove_extra_backslashes;


//   checks for UNC aware double separators remover \\

#[test]
fn remove_nothing() {
   let mut p = to_vector(r"nothing\here");
   unc_remove_extra_backslashes(&mut p);
   assert_eq!(p, to_vector(r"nothing\here"));
}

#[test]
fn remove_double() {
   let mut p = to_vector(r"basic\\double");
   unc_remove_extra_backslashes(&mut p);
   assert_eq!(p, to_vector(r"basic\double"));
}

#[test]
fn remove_multiple() {
   let mut p = to_vector(r"basic\\\\\multi");
   unc_remove_extra_backslashes(&mut p);
   assert_eq!(p, to_vector(r"basic\multi"));
}

#[test]
fn remove_multiple_at_unc_start() {
   let mut p = to_vector(r"\\\\\server\share");
   unc_remove_extra_backslashes(&mut p);
   assert_eq!(p, to_vector(r"\\server\share"));
}

#[test]
fn remove_multiple_in_unc_path() {
   let mut p = to_vector(r"\\\\\server\\\share");
   unc_remove_extra_backslashes(&mut p);
   assert_eq!(p, to_vector(r"\\server\share"));
}

#[test]
fn remove_multiple_at_end() {
   let mut p = to_vector(r"ending\slashes\\\\\");
   unc_remove_extra_backslashes(&mut p);
   assert_eq!(p, to_vector(r"ending\slashes\"));
}