Skip to content

Commit

Permalink
Rollup merge of rust-lang#76324 - ayushmishra2005:move_vec_tests_in_l…
Browse files Browse the repository at this point in the history
…ibrary, r=matklad

Move Vec slice UI tests in library

Moved some of Vec slice UI tests in Library as a part of rust-lang#76268

r? @matklad
  • Loading branch information
Dylan-DPC authored Sep 6, 2020
2 parents 97cd85d + d16bbd1 commit 378274b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 62 deletions.
23 changes: 23 additions & 0 deletions library/alloc/tests/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,29 @@ fn test_zip_unzip() {
assert_eq!((3, 6), (left[2], right[2]));
}

#[test]
fn test_cmp() {
let x: &[isize] = &[1, 2, 3, 4, 5];
let cmp: &[isize] = &[1, 2, 3, 4, 5];
assert_eq!(&x[..], cmp);
let cmp: &[isize] = &[3, 4, 5];
assert_eq!(&x[2..], cmp);
let cmp: &[isize] = &[1, 2, 3];
assert_eq!(&x[..3], cmp);
let cmp: &[isize] = &[2, 3, 4];
assert_eq!(&x[1..4], cmp);

let x: Vec<isize> = vec![1, 2, 3, 4, 5];
let cmp: &[isize] = &[1, 2, 3, 4, 5];
assert_eq!(&x[..], cmp);
let cmp: &[isize] = &[3, 4, 5];
assert_eq!(&x[2..], cmp);
let cmp: &[isize] = &[1, 2, 3];
assert_eq!(&x[..3], cmp);
let cmp: &[isize] = &[2, 3, 4];
assert_eq!(&x[1..4], cmp);
}

#[test]
fn test_vec_truncate_drop() {
static mut DROPS: u32 = 0;
Expand Down
62 changes: 0 additions & 62 deletions src/test/ui/array-slice-vec/slice-2.rs

This file was deleted.

0 comments on commit 378274b

Please sign in to comment.