This commit is contained in:
veeso
2022-08-17 10:33:31 +02:00
parent cce0c92c0b
commit a22c5025d7
21 changed files with 52 additions and 52 deletions

View File

@@ -32,7 +32,7 @@ mod tests {
fn test_utils_crypto_aes128() {
let key: &str = "MYSUPERSECRETKEY";
let input: &str = "Hello world!";
let secret: String = aes128_b64_crypt(&key, input);
let secret: String = aes128_b64_crypt(key, input);
assert_eq!(secret.as_str(), "z4Z6LpcpYqBW4+bkIok+5A==");
assert_eq!(
aes128_b64_decrypt(key, secret.as_str())

View File

@@ -300,7 +300,7 @@ mod tests {
#[test]
fn test_utils_fmt_time() {
let system_time: SystemTime = SystemTime::from(SystemTime::UNIX_EPOCH);
let system_time: SystemTime = SystemTime::UNIX_EPOCH;
assert_eq!(
fmt_time(system_time, "%Y-%m-%d"),
String::from("1970-01-01")
@@ -326,12 +326,12 @@ mod tests {
#[test]
#[cfg(target_family = "unix")]
fn test_utils_fmt_path_elide() {
let p: &Path = &Path::new("/develop/pippo");
let p: &Path = Path::new("/develop/pippo");
// Under max size
assert_eq!(fmt_path_elide(p, 16), String::from("/develop/pippo"));
// Above max size, only one ancestor
assert_eq!(fmt_path_elide(p, 8), String::from("/develop/pippo"));
let p: &Path = &Path::new("/develop/pippo/foo/bar");
let p: &Path = Path::new("/develop/pippo/foo/bar");
assert_eq!(fmt_path_elide(p, 16), String::from("/develop/…/foo/bar"));
}

View File

@@ -94,11 +94,11 @@ mod test {
#[test]
fn absolutize_path() {
assert_eq!(
absolutize(&Path::new("/home/omar"), &Path::new("readme.txt")).as_path(),
absolutize(Path::new("/home/omar"), Path::new("readme.txt")).as_path(),
Path::new("/home/omar/readme.txt")
);
assert_eq!(
absolutize(&Path::new("/home/omar"), &Path::new("/tmp/readme.txt")).as_path(),
absolutize(Path::new("/home/omar"), Path::new("/tmp/readme.txt")).as_path(),
Path::new("/tmp/readme.txt")
);
}