1
- #[ cfg( target_arch = "wasm32 " ) ]
2
- use wasm_bindgen_test:: * ;
1
+ #[ cfg( target_family = "wasm " ) ]
2
+ use wasm_bindgen_test:: wasm_bindgen_test as test ;
3
3
4
- #[ cfg( target_arch = "wasm32 " ) ]
4
+ #[ cfg( target_family = "wasm " ) ]
5
5
wasm_bindgen_test:: wasm_bindgen_test_configure!( run_in_browser) ;
6
6
7
7
#[ test]
8
- #[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test) ]
9
8
fn bool ( ) {
10
9
for x in & [ false , true ] {
11
10
while fastrand:: bool ( ) != * x { }
12
11
}
13
12
}
14
13
15
14
#[ test]
16
- #[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test) ]
17
15
fn u8 ( ) {
18
16
for x in 0 ..10 {
19
17
while fastrand:: u8 ( ..10 ) != x { }
@@ -25,7 +23,6 @@ fn u8() {
25
23
}
26
24
27
25
#[ test]
28
- #[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test) ]
29
26
fn i8 ( ) {
30
27
for x in -128 ..-120 {
31
28
while fastrand:: i8 ( ..-120 ) != x { }
@@ -37,7 +34,6 @@ fn i8() {
37
34
}
38
35
39
36
#[ test]
40
- #[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test) ]
41
37
fn u32 ( ) {
42
38
for n in 1u32 ..10_000 {
43
39
let n = n. wrapping_mul ( n) ;
@@ -51,7 +47,6 @@ fn u32() {
51
47
}
52
48
53
49
#[ test]
54
- #[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test) ]
55
50
fn u64 ( ) {
56
51
for n in 1u64 ..10_000 {
57
52
let n = n. wrapping_mul ( n) ;
@@ -66,7 +61,6 @@ fn u64() {
66
61
}
67
62
68
63
#[ test]
69
- #[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test) ]
70
64
fn u128 ( ) {
71
65
for n in 1u128 ..10_000 {
72
66
let n = n. wrapping_mul ( n) ;
@@ -82,7 +76,6 @@ fn u128() {
82
76
}
83
77
84
78
#[ test]
85
- #[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test) ]
86
79
fn fill ( ) {
87
80
let r = fastrand:: Rng :: new ( ) ;
88
81
let mut a = [ 0u8 ; 64 ] ;
@@ -95,7 +88,6 @@ fn fill() {
95
88
}
96
89
97
90
#[ test]
98
- #[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test) ]
99
91
fn rng ( ) {
100
92
let r = fastrand:: Rng :: new ( ) ;
101
93
@@ -109,7 +101,6 @@ fn rng() {
109
101
}
110
102
111
103
#[ test]
112
- #[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test) ]
113
104
fn rng_init ( ) {
114
105
let a = fastrand:: Rng :: new ( ) ;
115
106
let b = fastrand:: Rng :: new ( ) ;
@@ -121,7 +112,6 @@ fn rng_init() {
121
112
}
122
113
123
114
#[ test]
124
- #[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test) ]
125
115
fn with_seed ( ) {
126
116
let a = fastrand:: Rng :: with_seed ( 7 ) ;
127
117
let b = fastrand:: Rng :: new ( ) ;
0 commit comments