normalizefs 0.0.11

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


//   Removes dot slash "./" at start of the path

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

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

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

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

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

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