Skip to content

Commit 1890372

Browse files
committed
Update tests.
1 parent 4d7daa0 commit 1890372

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/std/src/io/tests.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -423,18 +423,18 @@ fn io_slice_mut_advance_slices() {
423423
}
424424

425425
#[test]
426+
#[should_panic]
426427
fn 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]
433434
fn 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]
466467
fn 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]
473474
fn 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
}

0 commit comments

Comments
 (0)