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:
50
src/rsync.rs
50
src/rsync.rs
@ -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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user