normalizefs 0.0.11

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


//   Removes slash dot slash "/./" - reference to current directory

#[test]
fn remove_nothing() {
   let mut p = to_vector("nothing/here");
   remove_slash_dot_slash(&mut p, '/');
   assert_eq!(p, to_vector("nothing/here"));
}

#[test]
fn remove_mid_dot_slash_test() {
   let mut p = to_vector("nothing/./here/");
   remove_slash_dot_slash(&mut p, '/');
   assert_eq!(p, to_vector("nothing/here/"));
}

#[test]
fn remove_double_mid_dot_slash_test() {
   let mut p = to_vector("nothing/././here/");
   remove_slash_dot_slash(&mut p, '/');
   assert_eq!(p, to_vector("nothing/here/"));
}

#[test]
fn remove_end_dot_slash_test() {
   let mut p = to_vector("nothing/./");
   remove_slash_dot_slash(&mut p, '/');
   assert_eq!(p, to_vector("nothing/"));
}

#[test]
fn too_short() {
   let mut p = to_vector("/");
   remove_slash_dot_slash(&mut p, '/');
   assert_eq!(p, to_vector("/"));
}

#[test]
fn dot_slash_only() {
   let mut p = to_vector("/./");
   remove_slash_dot_slash(&mut p, '/');
   assert_eq!(p, to_vector("/"));
}