From a9832b3d36f4cea4094453c4c6ba96843c222608 Mon Sep 17 00:00:00 2001 From: fdai7381 Date: Tue, 24 Jan 2023 11:14:52 +0100 Subject: [PATCH 1/2] test: add format uptime minutes test --- src/builtins/fetch.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/builtins/fetch.rs b/src/builtins/fetch.rs index 0f00892..de628c6 100644 --- a/src/builtins/fetch.rs +++ b/src/builtins/fetch.rs @@ -65,4 +65,9 @@ mod tests { fn test_format_uptime_seconds() { assert_eq!(format_uptime(35), "0h 0m 35s"); } + + #[test] + fn test_format_uptime_minutes() { + assert_eq!(format_uptime(135), "0h 2m 15s"); + } } From a627f8ba29d763580d70cddab238df9ca68a29fc Mon Sep 17 00:00:00 2001 From: fdai7381 Date: Tue, 24 Jan 2023 11:17:47 +0100 Subject: [PATCH 2/2] test: add format uptime hours test --- src/builtins/fetch.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/builtins/fetch.rs b/src/builtins/fetch.rs index de628c6..7ba16aa 100644 --- a/src/builtins/fetch.rs +++ b/src/builtins/fetch.rs @@ -70,4 +70,9 @@ mod tests { fn test_format_uptime_minutes() { assert_eq!(format_uptime(135), "0h 2m 15s"); } + + #[test] + fn test_format_uptime_hours() { + assert_eq!(format_uptime(3735), "1h 2m 15s"); + } }