mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
lint
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
|
||||
|
||||
@@ -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")
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user