INNER CODE UNIT · Rust

default_creates_new_hashmapid

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

    fn default_creates_new_hashmapid() {
        let hash: HashMapId<i32> = HashMapId::default();
        assert_eq!(hash.id_seed, 0);
        assert!(hash.store.is_empty());
    }

    // fmt

    #[test]
    fn fmt_formats_the_hashmapid() {
        let mut hash: HashMapId<i32> = HashMapId::default();
        hash.add(10);

        let expected = format!("HashMapId {{ id_seed: {}, type: \"i32\" }}", hash.id_seed);
        let result = format!("{:?}", hash);

        assert_eq!(result, expected);
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…