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" 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();