mod second_test { use rt_lists::second::List; #[test] fn basics() { let mut list = List::new(); assert_eq!(list.pop(), None); } #[test] fn basc_push_pop() { let mut list = List::new(); list.push(1); list.push(2); list.push(3); assert_eq!(list.peek(), Some(3)); assert_eq!(list.pop(), Some(3)); assert_eq!(list.pop(), Some(2)); list.push(4); assert_eq!(list.pop(), Some(4)); assert_eq!(list.pop(), Some(1)); assert_eq!(list.pop(), None); } }