Remove irrelevant tests

Because StoreId objects do not contain bases anymore, we do not need
these tests anymore.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
Matthias Beyer 2019-02-15 22:10:46 +01:00
parent 0888e4345c
commit 6fd2c9b958

View file

@ -348,10 +348,6 @@ impl<'a> StoreIdIteratorWithStore<'a> {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use std::path::PathBuf;
use storeid::StoreId;
use storeid::StoreIdWithBase;
use storeid::IntoStoreId; use storeid::IntoStoreId;
module_entry_path_mod!("test"); module_entry_path_mod!("test");
@ -363,70 +359,6 @@ mod test {
assert_eq!(p.into_storeid().unwrap().to_str().unwrap(), "test/test"); assert_eq!(p.into_storeid().unwrap().to_str().unwrap(), "test/test");
} }
#[test]
fn test_baseless_path() {
let id = StoreId::new(PathBuf::from("test"));
assert!(id.is_ok());
assert_eq!(id.unwrap(), StoreId(PathBuf::from("test")));
}
#[test]
fn test_base_path() {
let id = StoreId::new(PathBuf::from("test"));
assert!(id.is_ok());
assert_eq!(id.unwrap(), StoreId(PathBuf::from("test")));
}
#[test]
fn test_adding_base_to_baseless_path() {
let id = StoreId::new(PathBuf::from("test"));
assert!(id.is_ok());
let id = id.unwrap();
assert_eq!(id, StoreId(PathBuf::from("test")));
let storebase = PathBuf::from("/tmp/");
let id = id.with_base(&storebase);
assert_eq!(id, StoreIdWithBase(&PathBuf::from("/tmp/"), PathBuf::from("test")));
}
#[test]
fn test_removing_base_from_base_path() {
let id = StoreId::new(PathBuf::from("/tmp/test"));
assert!(id.is_ok());
let storebase = PathBuf::from("/tmp/");
let id = id.unwrap().with_base(&storebase);
assert_eq!(id, StoreIdWithBase(&PathBuf::from("/tmp/"), PathBuf::from("test")));
let id = id.without_base();
assert_eq!(id, StoreId(PathBuf::from("test")));
}
#[test]
fn test_basefull_into_pathbuf_is_ok() {
let id = StoreId::new(PathBuf::from("/tmp/test"));
assert!(id.is_ok());
let storebase = PathBuf::from("/tmp/");
let id = id.unwrap().with_base(&storebase);
assert!(id.into_pathbuf().is_ok());
}
#[test]
fn test_basefull_into_pathbuf_is_correct() {
let id = StoreId::new(PathBuf::from("/tmp/test"));
assert!(id.is_ok());
let storebase = PathBuf::from("/tmp/");
let pb = id.unwrap().with_base(&storebase).into_pathbuf();
assert!(pb.is_ok());
assert_eq!(pb.unwrap(), PathBuf::from("/tmp/test"));
}
#[test] #[test]
fn storeid_in_collection() { fn storeid_in_collection() {
let p = module_path::ModuleEntryPath::new("1/2/3/4/5/6/7/8/9/0").into_storeid().unwrap(); let p = module_path::ModuleEntryPath::new("1/2/3/4/5/6/7/8/9/0").into_storeid().unwrap();