aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/whirl_common/tests/test.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/crates/whirl_common/tests/test.rs b/crates/whirl_common/tests/test.rs
new file mode 100644
index 0000000..5878021
--- /dev/null
+++ b/crates/whirl_common/tests/test.rs
@@ -0,0 +1,21 @@
+// Copyleft (ɔ) 2021-2021 The Whirlsplash Collective
+// SPDX-License-Identifier: GPL-3.0-only
+
+#[test]
+fn vec_alphabetically() {
+ assert_eq!(vec!["a", "b", "c", "d"], {
+ let mut vector = vec!["a", "c", "d", "b"];
+
+ whirl_common::sort::vec_alphabetically(&mut vector);
+
+ vector
+ });
+}
+
+#[test]
+fn seconds_to_hrtime() {
+ assert_eq!(
+ "125 weeks, 14 days, 9 hours, 37 mins, 57 secs",
+ whirl_common::system::seconds_to_hrtime(1623058677),
+ );
+}