mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-09-28 04:50:34 +00:00
Add asserts for Vec::len() in test push_and_pop() (was sanity).
This commit is contained in:
parent
5b91d6821a
commit
692bd418f1
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user