INNER CODE UNIT · Rust

remove_removes_id

lunatic-solutions/lunatic · crates/hash-map-id/src/lib.rs:156

    fn remove_removes_id() {
        let mut hash: HashMapId<i32> = HashMapId::new();
        let id = hash.add(10);
        hash.remove(id);
        assert_eq!(hash.get(id), None);
    }

    #[test]
    fn remove_does_not_affect_other_items() {
        let mut hash: HashMapId<i32> = HashMapId::new();

        let value1 = 10;
        let value2 = 20;
        let value3 = 30;

        let id1 = hash.add(value1);
        let id2 = hash.add(value2);
        let id3 = hash.add(value3);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…