@@ -15,30 +15,24 @@ fn test_arithmetic_ok() {
15
15
16
16
/// Tests addition wraps values when built in release mode.
17
17
#[ test]
18
- #[ cfg_attr( debug_assertions, ignore) ]
18
+ #[ cfg_attr( debug_assertions, ignore = "works in release builds only" ) ]
19
19
fn test_arithmetic_wrapping ( ) {
20
20
assert_eq ! ( Char :: Digit0 , Char :: Digit8 + 120 ) ;
21
21
assert_eq ! ( Char :: Digit0 , Char :: Digit8 + 248 ) ;
22
22
}
23
23
24
24
/// Tests addition panics in debug build when it produces an invalid ASCII char.
25
- ///
26
- /// Note: Rust tests (at least when run via `./x.py test library/core`) are
27
- /// built in release mode so this test is normally ignored. However, we have
28
- /// a doctest which checks the behaviour.
29
25
#[ test]
30
- #[ cfg_attr( not( debug_assertions) , ignore) ]
26
+ #[ cfg_attr( not( debug_assertions) , ignore = "works in debug builds only" ) ]
27
+ #[ should_panic]
31
28
fn test_arithmetic_non_ascii ( ) {
32
29
let _ = Char :: Digit0 + 120 ;
33
30
}
34
31
35
32
/// Tests addition panics in debug build when it overflowing u8.
36
- ///
37
- /// Note: Rust tests (at least when run via `./x.py test library/core`) are
38
- /// built in release mode so this test is normally ignored. However, we have
39
- /// a doctest which checks the behaviour.
40
33
#[ test]
41
- #[ cfg_attr( not( debug_assertions) , ignore) ]
34
+ #[ cfg_attr( not( debug_assertions) , ignore = "works in debug builds only" ) ]
35
+ #[ should_panic]
42
36
fn test_arithmetic_overflow ( ) {
43
37
let _ = Char :: Digit0 + 250 ;
44
38
}
0 commit comments