import { describe, it, expect } from "vitest";
import { MatchingEngine } from "../src/matching/MatchingEngine";
import { DataSource } from "@shieldai/types";

describe("MatchingEngine", () => {
  const engine = new MatchingEngine();

  it("computes consistent content hash", () => {
    const hash1 = engine.computeContentHash(DataSource.HIBP, "TestBreach", "item-123");
    const hash2 = engine.computeContentHash(DataSource.HIBP, "TestBreach", "item-123");
    expect(hash1).toBe(hash2);
    expect(hash1).toHaveLength(64);
  });

  it("produces different hashes for different inputs", () => {
    const hash1 = engine.computeContentHash(DataSource.HIBP, "BreachA", "item-123");
    const hash2 = engine.computeContentHash(DataSource.HIBP, "BreachB", "item-123");
    expect(hash1).not.toBe(hash2);
  });
});
