1- #[ cfg( feature = "wasm-bindgen" ) ]
1+ // Explictly use the Custom RNG crates to link them in.
2+ #[ cfg( feature = "test-stdweb" ) ]
3+ use getrandom_stdweb as _;
4+ #[ cfg( feature = "test-bindgen" ) ]
5+ use getrandom_wasm_bindgen as _;
6+
7+ #[ cfg( feature = "test-bindgen" ) ]
28use wasm_bindgen_test:: * ;
39
410use getrandom:: getrandom;
511
612#[ cfg( feature = "test-in-browser" ) ]
713wasm_bindgen_test_configure ! ( run_in_browser) ;
814
9- #[ cfg_attr( feature = "wasm -bindgen" , wasm_bindgen_test) ]
15+ #[ cfg_attr( feature = "test -bindgen" , wasm_bindgen_test) ]
1016#[ test]
1117fn test_zero ( ) {
1218 // Test that APIs are happy with zero-length requests
1319 getrandom ( & mut [ 0u8 ; 0 ] ) . unwrap ( ) ;
1420}
1521
16- #[ cfg_attr( feature = "wasm -bindgen" , wasm_bindgen_test) ]
22+ #[ cfg_attr( feature = "test -bindgen" , wasm_bindgen_test) ]
1723#[ test]
1824fn test_diff ( ) {
1925 let mut v1 = [ 0u8 ; 1000 ] ;
@@ -31,7 +37,7 @@ fn test_diff() {
3137 assert ! ( n_diff_bits >= v1. len( ) as u32 ) ;
3238}
3339
34- #[ cfg_attr( feature = "wasm -bindgen" , wasm_bindgen_test) ]
40+ #[ cfg_attr( feature = "test -bindgen" , wasm_bindgen_test) ]
3541#[ test]
3642fn test_huge ( ) {
3743 let mut huge = [ 0u8 ; 100_000 ] ;
0 commit comments