matcat 0.2.1

Material Categories & Variants — human-friendly layer on top of utomid chemistry.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use matcat::{MatCatId, props_for};

#[test]
fn procedural_props_are_deterministic() {
    let id = MatCatId::new(1, 42, 7);
    let props1 = props_for(&id);
    let props2 = props_for(&id);
    assert_eq!(format!("{:?}", props1), format!("{:?}", props2), "props must be deterministic");
}

#[test]
fn different_ids_give_different_props() {
    let id1 = MatCatId::new(1, 42, 7);
    let id2 = MatCatId::new(1, 42, 8);
    let props1 = props_for(&id1);
    let props2 = props_for(&id2);
    assert_ne!(format!("{:?}", props1), format!("{:?}", props2), "props should vary across IDs");
}