From 0ada689b7d45c2790d16c7dba631f5d517f1522c Mon Sep 17 00:00:00 2001 From: fdai7381 Date: Tue, 24 Jan 2023 11:11:37 +0100 Subject: [PATCH] test: add format uptime seconds test --- src/builtins/fetch.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/builtins/fetch.rs b/src/builtins/fetch.rs index 89c7592..0f00892 100644 --- a/src/builtins/fetch.rs +++ b/src/builtins/fetch.rs @@ -56,3 +56,13 @@ fn format_uptime(uptime: u64) -> String { fn bytes_to_mega_bytes(bytes: u64) -> u64 { bytes / 1024 / 1024 } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_format_uptime_seconds() { + assert_eq!(format_uptime(35), "0h 0m 35s"); + } +}