aboutsummaryrefslogtreecommitdiff
path: root/crates/whirl_common/tests/test.rs
blob: d786fa413dd7e2cb6b9175c3eedabe17212e5505 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright (C) 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::unixts_to_hrtime(1623058677),
  );
}