1
0
mirror of https://github.com/NLnetLabs/routinator.git synced 2024-05-19 06:50:04 +00:00

Remove broken tests.

This commit is contained in:
Martin Hoffmann
2018-07-26 16:38:40 +02:00
parent 09620d442e
commit 47682e3f2e

View File

@ -266,53 +266,3 @@ pub enum UriError {
BadScheme, BadScheme,
} }
//============ Testing =======================================================
#[cfg(test)]
mod test {
use super::*;
fn from_parts(
auth: &'static str,
module: &'static str,
path: &'static str,
is_dir: bool
) -> Uri {
Uri {
authority: Bytes::from_static(auth.as_bytes()),
module: Bytes::from_static(module.as_bytes()),
path: Bytes::from_static(path.as_bytes()),
is_dir
}
}
#[test]
fn parse() {
assert_eq!(
Uri::from_slice(b"rsync://user@foo.bar:322/mod/path").unwrap(),
from_parts("user@foo.bar:322", "mod", "path", false)
);
assert_eq!(
Uri::from_slice(b"rsync://user@foo.bar:322/mod/path/").unwrap(),
from_parts("user@foo.bar:322", "mod", "path", true)
);
}
#[test]
fn parent() {
let uri = Uri::from_slice(b"rsync://auth/mod/a/b/c").unwrap();
assert_eq!(uri.path(), "a/b/c");
assert!(!uri.is_dir());
let uri = uri.parent().unwrap();
assert_eq!(uri.path(), "a/b");
assert!(uri.is_dir());
let uri = uri.parent().unwrap();
assert_eq!(uri.path(), "a");
assert!(uri.is_dir());
let uri = uri.parent().unwrap();
assert_eq!(uri.path(), "");
assert!(uri.is_dir());
assert_eq!(uri.parent(), None)
}
}