forked from mplanchard/cuid-rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: adapt cuid1, cuid2 to avoid runtime panics on wasm32-unknown-unk…
…nown
- Loading branch information
Showing
8 changed files
with
65 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use wasm_bindgen_test::*; | ||
Check failure on line 1 in crates/cuid/tests/wasm.rs GitHub Actions / Test (ubuntu-latest, nightly, -p cuid)
|
||
use wasm_rs_dbg::dbg; | ||
Check failure on line 2 in crates/cuid/tests/wasm.rs GitHub Actions / Test (ubuntu-latest, nightly, -p cuid)
|
||
|
||
#[wasm_bindgen_test] | ||
Check failure on line 4 in crates/cuid/tests/wasm.rs GitHub Actions / Test (ubuntu-latest, nightly, -p cuid)
|
||
fn cuid1_length() { | ||
// e.g.: "cm3rpdbhn0001w10gi9au8cul" | ||
let id = cuid::cuid1(); | ||
dbg!("cuid1: {}", &id); | ||
|
||
assert!(id.len() == 25); | ||
} | ||
|
||
#[wasm_bindgen_test] | ||
Check failure on line 13 in crates/cuid/tests/wasm.rs GitHub Actions / Test (ubuntu-latest, nightly, -p cuid)
|
||
fn cuid2_length() { | ||
// e.g.: "u8yjmh700jcegr5oi3onij1u" | ||
let id = cuid::cuid2(); | ||
dbg!("cuid2: {}", &id); | ||
|
||
assert!(id.len() == 24); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters