File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -423,18 +423,18 @@ fn io_slice_mut_advance_slices() {
423423}
424424
425425#[ test]
426+ #[ should_panic]
426427fn io_slice_mut_advance_slices_empty_slice ( ) {
427428 let mut empty_bufs = & mut [ ] [ ..] ;
428- // Shouldn't panic.
429429 IoSliceMut :: advance_slices ( & mut empty_bufs, 1 ) ;
430430}
431431
432432#[ test]
433+ #[ should_panic]
433434fn io_slice_mut_advance_slices_beyond_total_length ( ) {
434435 let mut buf1 = [ 1 ; 8 ] ;
435436 let mut bufs = & mut [ IoSliceMut :: new ( & mut buf1) ] [ ..] ;
436437
437- // Going beyond the total length should be ok.
438438 IoSliceMut :: advance_slices ( & mut bufs, 9 ) ;
439439 assert ! ( bufs. is_empty( ) ) ;
440440}
@@ -463,18 +463,18 @@ fn io_slice_advance_slices() {
463463}
464464
465465#[ test]
466+ #[ should_panic]
466467fn io_slice_advance_slices_empty_slice ( ) {
467468 let mut empty_bufs = & mut [ ] [ ..] ;
468- // Shouldn't panic.
469469 IoSlice :: advance_slices ( & mut empty_bufs, 1 ) ;
470470}
471471
472472#[ test]
473+ #[ should_panic]
473474fn io_slice_advance_slices_beyond_total_length ( ) {
474475 let buf1 = [ 1 ; 8 ] ;
475476 let mut bufs = & mut [ IoSlice :: new ( & buf1) ] [ ..] ;
476477
477- // Going beyond the total length should be ok.
478478 IoSlice :: advance_slices ( & mut bufs, 9 ) ;
479479 assert ! ( bufs. is_empty( ) ) ;
480480}
You can’t perform that action at this time.
0 commit comments