Skip to content

Commit

Permalink
chore: prepare 0.1.6 (#35)
Browse files Browse the repository at this point in the history
* chore: prepare 0.1.6

Signed-off-by: Zhenchi <[email protected]>

* test: add unit test for unix time

Signed-off-by: Zhenchi <[email protected]>

---------

Signed-off-by: Zhenchi <[email protected]>
  • Loading branch information
zhongzc authored Jan 24, 2024
1 parent b77884c commit f07d5cf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "minstant"
version = "0.1.5"
version = "0.1.6"
authors = ["The TiKV Authors"]
edition = "2021"
license = "MIT"
Expand Down
9 changes: 9 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f07d5cf

Please sign in to comment.