Partial implementation of Tasks and Logs and test refactor

This commit is contained in:
2023-08-08 10:50:06 -06:00
parent 9d943a266e
commit 519778c0ca
42 changed files with 9914 additions and 9436 deletions
+28
View File
@@ -0,0 +1,28 @@
#[cfg(test)]
mod tests {
use pretty_assertions::assert_eq;
use crate::utils::{convert_runtime, convert_to_gb, strip_non_search_characters};
#[test]
fn test_convert_to_gb() {
assert_eq!(convert_to_gb(2147483648), 2f64);
assert_eq!(convert_to_gb(2662879723), 2.4799999995157123);
}
#[test]
fn test_convert_runtime() {
let (hours, minutes) = convert_runtime(154);
assert_eq!(hours, 2);
assert_eq!(minutes, 34);
}
#[test]
fn test_strip_non_alphanumeric_characters() {
assert_eq!(
strip_non_search_characters("Te$t S7r!ng::'~-@_`,(.)/*}^&%#+="),
"tet s7rng::'-,./".to_owned()
)
}
}