File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,7 @@ matrix:
144
144
- cargo web -V
145
145
- cargo list | grep install-update || cargo install -f cargo-update
146
146
- cargo install-update -i cargo-update wasm-bindgen-cli
147
+ - cargo install-update -i cargo-update wasm-pack
147
148
addons :
148
149
chrome : stable
149
150
script :
@@ -159,6 +160,7 @@ matrix:
159
160
- cargo build --manifest-path tests/wasm_bindgen/Cargo.toml --target wasm32-unknown-unknown
160
161
- wasm-bindgen --nodejs target/wasm32-unknown-unknown/debug/rand_wasm_bindgen_test.wasm --out-dir tests/wasm_bindgen/js
161
162
- node tests/wasm_bindgen/js/index.js
163
+ - wasm-pack test --node tests/wasm_bindgen
162
164
163
165
- rust : nightly
164
166
env : DESCRIPTION="cross-platform builder (doesn't run tests)"
Original file line number Diff line number Diff line change @@ -12,3 +12,4 @@ crate-type = ["cdylib"]
12
12
[dependencies ]
13
13
rand = { path = " ../.." , features = [" wasm-bindgen" ] }
14
14
wasm-bindgen = " 0.2"
15
+ wasm-bindgen-test = " 0.2"
Original file line number Diff line number Diff line change 1
1
extern crate rand;
2
2
extern crate wasm_bindgen;
3
+ extern crate wasm_bindgen_test;
3
4
4
5
use rand:: rngs:: { OsRng , StdRng } ;
5
6
use rand:: FromEntropy ;
@@ -20,3 +21,22 @@ pub fn generate_from_os_rand() -> i32 {
20
21
pub fn generate_from_entropy ( ) -> i32 {
21
22
StdRng :: from_entropy ( ) . gen ( )
22
23
}
24
+
25
+ pub mod tests {
26
+ use wasm_bindgen_test:: * ;
27
+
28
+ #[ wasm_bindgen_test]
29
+ fn generate_from_seed ( ) {
30
+ let _ = super :: generate_from_seed ( 42 ) ;
31
+ }
32
+
33
+ #[ wasm_bindgen_test]
34
+ fn generate_from_os_rand ( ) {
35
+ let _ = super :: generate_from_os_rand ( ) ;
36
+ }
37
+
38
+ #[ wasm_bindgen_test]
39
+ fn generate_from_entropy ( ) {
40
+ let _ = super :: generate_from_entropy ( ) ;
41
+ }
42
+ }
You can’t perform that action at this time.
0 commit comments