From fce1a5a54ca3b72a34a1cf05d13e42f3e19bb083 Mon Sep 17 00:00:00 2001 From: Zhenchi Date: Wed, 24 Jan 2024 07:27:27 +0000 Subject: [PATCH 1/2] chore: prepare 0.1.6 Signed-off-by: Zhenchi --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 26b13cb..8c223fb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minstant" -version = "0.1.5" +version = "0.1.6" authors = ["The TiKV Authors"] edition = "2021" license = "MIT" From 4b8c025291eaa1a1613adf32b6dc9c3b195589b1 Mon Sep 17 00:00:00 2001 From: Zhenchi Date: Wed, 24 Jan 2024 07:31:51 +0000 Subject: [PATCH 2/2] test: add unit test for unix time Signed-off-by: Zhenchi --- src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index d069405..77b8247 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -121,6 +121,15 @@ mod tests { let _ = nanos_per_cycle(); } + #[test] + #[wasm_bindgen_test] + fn test_unix_time() { + let now = Instant::now(); + let anchor = Anchor::new(); + let unix_nanos = now.as_unix_nanos(&anchor); + assert!(unix_nanos > 0); + } + #[test] fn test_duration() { let mut rng = rand::thread_rng();