Skip to content

Commit

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

Move Vec slice UI tests in library

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

r? @matklad
  • Loading branch information
Dylan-DPC authored Sep 6, 2020
2 parents acd33e1 + d16bbd1 commit 1b24f14
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 1b24f14

Please sign in to comment.