normalizefs 0.0.11

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


//   Removes dot after slash "/." at end of path

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

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

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

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