We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1aa4dd0 + 4e4f8ab commit 0d664f9Copy full SHA for 0d664f9
src/liballoc/linked_list.rs
@@ -1288,6 +1288,8 @@ mod tests {
1288
let mut node_ptr: &Node<T>;
1289
match list.head {
1290
None => {
1291
+ // tail node should also be None.
1292
+ assert!(list.tail.is_none());
1293
assert_eq!(0, list.len);
1294
return;
1295
}
@@ -1314,6 +1316,11 @@ mod tests {
1314
1316
1315
1317
1318
1319
+
1320
+ // verify that the tail node points to the last node.
1321
+ let tail = list.tail.as_ref().expect("some tail node").as_ref();
1322
+ assert_eq!(tail as *const Node<T>, node_ptr as *const Node<T>);
1323
+ // check that len matches interior links.
1324
assert_eq!(len, list.len);
1325
1326
0 commit comments