Add asserts for Vec::len() in test push_and_pop() (was sanity).

This commit is contained in:
Alex Helfet 2017-12-19 20:02:25 +00:00
parent 5b91d6821a
commit 692bd418f1

View File

@ -236,15 +236,20 @@ mod tests {
}
#[test]
fn sanity() {
fn push_and_pop() {
let mut v: Vec<i32, [i32; 4]> = Vec::new();
assert_eq!(v.len(), 0);
assert_eq!(v.pop(), None);
assert_eq!(v.len(), 0);
v.push(0).unwrap();
assert_eq!(v.len(), 1);
assert_eq!(v.pop(), Some(0));
assert_eq!(v.len(), 0);
assert_eq!(v.pop(), None);
assert_eq!(v.len(), 0);
}
}