File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,10 @@ fn main() {
61
61
test ( |_old_val| { let _val = [ 0 , 1 , 2 ] [ 4 ] ; loop { } } ) ;
62
62
test ( |_old_val| { let _val = 1 /0 ; loop { } } ) ;
63
63
64
+ // Assertion and debug assertion
65
+ test ( |_old_val| { assert ! ( false ) ; loop { } } ) ;
66
+ test ( |_old_val| { debug_assert ! ( false ) ; loop { } } ) ;
67
+
64
68
// Cleanup: reset to default hook.
65
69
drop ( std:: panic:: take_hook ( ) ) ;
66
70
Original file line number Diff line number Diff line change @@ -16,4 +16,8 @@ thread 'main' panicked at 'index out of bounds: the len is 3 but the index is 4'
16
16
Caught panic message (String): index out of bounds: the len is 3 but the index is 4
17
17
thread 'main' panicked at 'attempt to divide by zero', $DIR/catch_panic.rs:62:34
18
18
Caught panic message (String): attempt to divide by zero
19
+ thread 'main' panicked at 'assertion failed: false', $DIR/catch_panic.rs:65:23
20
+ Caught panic message (&str): assertion failed: false
21
+ thread 'main' panicked at 'assertion failed: false', $DIR/catch_panic.rs:66:23
22
+ Caught panic message (&str): assertion failed: false
19
23
Success!
You can’t perform that action at this time.
0 commit comments