Lines Matching refs:m
1423 let mut m = RBTree::new(); in test_insert() localVariable
1424 assert_eq!(m.len(), 0); in test_insert()
1425 m.insert(1, 2); in test_insert()
1426 assert_eq!(m.len(), 1); in test_insert()
1427 m.insert(2, 4); in test_insert()
1428 assert_eq!(m.len(), 2); in test_insert()
1429 m.insert(2, 6); in test_insert()
1430 assert_eq!(m.len(), 3); in test_insert()
1431 assert_eq!(*m.get(&1).unwrap(), 2); in test_insert()
1432 assert_eq!(*m.get(&2).unwrap(), 4); in test_insert()
1433 assert_eq!(*m.get(&2).unwrap(), 4); in test_insert()
1438 let mut m = RBTree::new(); in test_replace() localVariable
1439 assert_eq!(m.len(), 0); in test_replace()
1440 m.insert(2, 4); in test_replace()
1441 assert_eq!(m.len(), 1); in test_replace()
1442 assert_eq!(m.replace_or_insert(2, 6).unwrap(), 4); in test_replace()
1443 assert_eq!(m.len(), 1); in test_replace()
1444 assert_eq!(*m.get(&2).unwrap(), 6); in test_replace()
1449 let mut m = RBTree::new(); in test_clone() localVariable
1450 assert_eq!(m.len(), 0); in test_clone()
1451 m.insert(1, 2); in test_clone()
1452 assert_eq!(m.len(), 1); in test_clone()
1453 m.insert(2, 4); in test_clone()
1454 assert_eq!(m.len(), 2); in test_clone()
1455 let m2 = m.clone(); in test_clone()
1456 m.clear(); in test_clone()
1464 let mut m: RBTree<isize, bool> = RBTree::new(); in test_empty_remove() localVariable
1465 assert_eq!(m.remove(&0), None); in test_empty_remove()
1470 let mut m: RBTree<isize, bool> = RBTree::new(); in test_empty_iter() localVariable
1471 assert_eq!(m.iter().next(), None); in test_empty_iter()
1472 assert_eq!(m.iter_mut().next(), None); in test_empty_iter()
1473 assert_eq!(m.len(), 0); in test_empty_iter()
1474 assert!(m.is_empty()); in test_empty_iter()
1475 assert_eq!(m.into_iter().next(), None); in test_empty_iter()
1480 let mut m = RBTree::new(); in test_lots_of_insertions() localVariable
1485 assert!(m.is_empty()); in test_lots_of_insertions()
1488 m.insert(i, i); in test_lots_of_insertions()
1491 let r = m.get(&j); in test_lots_of_insertions()
1496 let r = m.get(&j); in test_lots_of_insertions()
1502 assert!(!m.contains_key(&i)); in test_lots_of_insertions()
1507 assert!(m.remove(&i).is_some()); in test_lots_of_insertions()
1510 assert!(!m.contains_key(&j)); in test_lots_of_insertions()
1514 assert!(m.contains_key(&j)); in test_lots_of_insertions()
1519 assert!(!m.contains_key(&i)); in test_lots_of_insertions()
1523 m.insert(i, i); in test_lots_of_insertions()
1528 assert!(m.remove(&i).is_some()); in test_lots_of_insertions()
1531 assert!(!m.contains_key(&j)); in test_lots_of_insertions()
1535 assert!(m.contains_key(&j)); in test_lots_of_insertions()
1543 let mut m = RBTree::new(); in test_find_mut() localVariable
1544 m.insert(1, 12); in test_find_mut()
1545 m.insert(2, 8); in test_find_mut()
1546 m.insert(5, 14); in test_find_mut()
1548 match m.get_mut(&5) { in test_find_mut()
1552 assert_eq!(m.get(&5), Some(&new)); in test_find_mut()
1557 let mut m = RBTree::new(); in test_remove() localVariable
1558 m.insert(1, 2); in test_remove()
1559 assert_eq!(*m.get(&1).unwrap(), 2); in test_remove()
1560 m.insert(5, 3); in test_remove()
1561 assert_eq!(*m.get(&5).unwrap(), 3); in test_remove()
1562 m.insert(9, 4); in test_remove()
1563 assert_eq!(*m.get(&1).unwrap(), 2); in test_remove()
1564 assert_eq!(*m.get(&5).unwrap(), 3); in test_remove()
1565 assert_eq!(*m.get(&9).unwrap(), 4); in test_remove()
1566 assert_eq!(m.remove(&1).unwrap(), 2); in test_remove()
1567 assert_eq!(m.remove(&5).unwrap(), 3); in test_remove()
1568 assert_eq!(m.remove(&9).unwrap(), 4); in test_remove()
1569 assert_eq!(m.len(), 0); in test_remove()
1574 let mut m = RBTree::new(); in test_is_empty() localVariable
1575 m.insert(1, 2); in test_is_empty()
1576 assert!(!m.is_empty()); in test_is_empty()
1577 assert!(m.remove(&1).is_some()); in test_is_empty()
1578 assert!(m.is_empty()); in test_is_empty()
1583 let mut m = RBTree::new(); in test_pop() localVariable
1584 m.insert(2, 4); in test_pop()
1585 m.insert(1, 2); in test_pop()
1586 m.insert(3, 6); in test_pop()
1587 assert_eq!(m.len(), 3); in test_pop()
1588 assert_eq!(m.pop_first(), Some((1, 2))); in test_pop()
1589 assert_eq!(m.len(), 2); in test_pop()
1590 assert_eq!(m.pop_last(), Some((3, 6))); in test_pop()
1591 assert_eq!(m.len(), 1); in test_pop()
1592 assert_eq!(m.get_first(), Some((&2, &4))); in test_pop()
1593 assert_eq!(m.get_last(), Some((&2, &4))); in test_pop()
1598 let mut m = RBTree::new(); in test_iterate() localVariable
1600 m.insert(i, i * 2); in test_iterate()
1602 assert_eq!(m.len(), 32); in test_iterate()
1606 for (k, v) in m.iter() { in test_iterate()
1651 let mut m = RBTree::new(); in test_find() localVariable
1652 assert!(m.get(&1).is_none()); in test_find()
1653 m.insert(1, 2); in test_find()
1654 match m.get(&1) { in test_find()