Browse Source

test: add format uptime seconds test

main
fdai7381 2 years ago
committed by fdai7451
parent
commit
e6f2271983
  1. 10
      src/builtins/fetch.rs

10
src/builtins/fetch.rs

@ -56,3 +56,13 @@ fn format_uptime(uptime: u64) -> String {
fn bytes_to_mega_bytes(bytes: u64) -> u64 { fn bytes_to_mega_bytes(bytes: u64) -> u64 {
bytes / 1024 / 1024 bytes / 1024 / 1024
} }
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_format_uptime_seconds() {
assert_eq!(format_uptime(35), "0h 0m 35s");
}
}
Loading…
Cancel
Save