//! UC-08-F4-1 — TagId uniqueness BDD scenario.
//!
//! Generates a large batch of TagIds and asserts pairwise uniqueness.
//! Collisions on UUIDv4 are astronomically unlikely — this guards the
//! per-emission `TagId::new()` contract on `LogTag::id()`.

use std::collections::HashSet;

use maat_sdk_types::types::TagId;

#[test]
fn tag_id_new_returns_unique_ids() {
    let mut ids = HashSet::new();
    for _ in 0..10_000 {
        let id = TagId::new();
        assert!(ids.insert(id), "collision: {:?}", id);
    }
}

#[test]
fn tag_id_nil_is_a_stable_sentinel() {
    let a = TagId::nil();
    let b = TagId::nil();
    assert_eq!(a, b);
}

#[test]
fn tag_id_new_does_not_equal_nil() {
    let new = TagId::new();
    let nil = TagId::nil();
    assert_ne!(new, nil);
}
