@@ -500,18 +500,21 @@ mod tests {
500
500
} ) ;
501
501
}
502
502
503
- #[ test]
503
+ #[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test) ]
504
+ #[ cfg_attr( not( target_arch = "wasm32" ) , test) ]
504
505
fn zero_as_exponent ( ) {
505
506
test_sets_as_base ( ALL , 0.0 , 1.0 ) ;
506
507
test_sets_as_base ( ALL , -0.0 , 1.0 ) ;
507
508
}
508
509
509
- #[ test]
510
+ #[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test) ]
511
+ #[ cfg_attr( not( target_arch = "wasm32" ) , test) ]
510
512
fn one_as_base ( ) {
511
513
test_sets_as_exponent ( 1.0 , ALL , 1.0 ) ;
512
514
}
513
515
514
- #[ test]
516
+ #[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test) ]
517
+ #[ cfg_attr( not( target_arch = "wasm32" ) , test) ]
515
518
fn nan_inputs ( ) {
516
519
// NAN as the base:
517
520
// (NAN ^ anything *but 0* should be NAN)
@@ -522,7 +525,8 @@ mod tests {
522
525
test_sets_as_base ( & ALL [ ..( ALL . len ( ) - 2 ) ] , NAN , NAN ) ;
523
526
}
524
527
525
- #[ test]
528
+ #[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test) ]
529
+ #[ cfg_attr( not( target_arch = "wasm32" ) , test) ]
526
530
fn infinity_as_base ( ) {
527
531
// Positive Infinity as the base:
528
532
// (+Infinity ^ positive anything but 0 and NAN should be +Infinity)
@@ -541,7 +545,8 @@ mod tests {
541
545
test_sets ( ALL , & |v : f64 | pow ( NEG_INFINITY , v) , & |v : f64 | pow ( -0.0 , -v) ) ;
542
546
}
543
547
544
- #[ test]
548
+ #[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test) ]
549
+ #[ cfg_attr( not( target_arch = "wasm32" ) , test) ]
545
550
fn infinity_as_exponent ( ) {
546
551
// Positive/Negative base greater than 1:
547
552
// (pos/neg > 1 ^ Infinity should be Infinity - note this excludes NAN as the base)
@@ -567,7 +572,8 @@ mod tests {
567
572
test_sets_as_base ( & [ NEG_ONE , POS_ONE ] , NEG_INFINITY , 1.0 ) ;
568
573
}
569
574
570
- #[ test]
575
+ #[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test) ]
576
+ #[ cfg_attr( not( target_arch = "wasm32" ) , test) ]
571
577
fn zero_as_base ( ) {
572
578
// Positive Zero as the base:
573
579
// (+0 ^ anything positive but 0 and NAN should be +0)
@@ -593,7 +599,8 @@ mod tests {
593
599
test_sets_as_exponent ( -0.0 , & [ NEG_ODDS ] , NEG_INFINITY ) ;
594
600
}
595
601
596
- #[ test]
602
+ #[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test) ]
603
+ #[ cfg_attr( not( target_arch = "wasm32" ) , test) ]
597
604
fn special_cases ( ) {
598
605
// One as the exponent:
599
606
// (anything ^ 1 should be anything - i.e. the base)
@@ -624,7 +631,8 @@ mod tests {
624
631
} ) ;
625
632
}
626
633
627
- #[ test]
634
+ #[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test) ]
635
+ #[ cfg_attr( not( target_arch = "wasm32" ) , test) ]
628
636
fn normal_cases ( ) {
629
637
assert_eq ! ( pow( 2.0 , 20.0 ) , ( 1 << 20 ) as f64 ) ;
630
638
assert_eq ! ( pow( -1.0 , 9.0 ) , -1.0 ) ;
0 commit comments