## Property-Based Tests for Variant Hash Calculation ## ## **Feature: 02-nip-dependency-resolution, Property 1: Hash Determinism** ## ## These tests verify that variant hash calculation is deterministic: ## - Same profile always produces same hash ## - Different profiles produce different hashes (with high probability) ## - Hash is independent of insertion order ## - Hash is platform-independent import std/[unittest, random, tables, sets] import ../src/nip/resolver/variant_types import ../src/nip/resolver/variant_hash suite "Property 1: Hash Determinism": test "Property 1.1: Same profile produces same hash (100 iterations)": ## **Validates: Requirements 1.5** ## ## For any variant profile, calculating the hash multiple times ## should always produce the same result var rng = initRand(42) # Deterministic seed for reproducibility var passCount = 0 for i in 0..<100: # Create random profile var profile = newVariantProfile() # Add random domains and flags let numDomains = rng.rand(1..5) for d in 0..