import { describe, it, expect } from "vitest";
import { uuidv5 } from "./uuidv5";

describe("uuidv5", () => {
  it("produces valid UUID format", () => {
    const id = uuidv5("ns", "name");
    expect(id).toMatch(/^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/);
  });

  it("is deterministic", () => {
    expect(uuidv5("ns", "name")).toBe(uuidv5("ns", "name"));
  });

  it("different inputs produce different IDs", () => {
    expect(uuidv5("ns", "a")).not.toBe(uuidv5("ns", "b"));
    expect(uuidv5("a", "name")).not.toBe(uuidv5("b", "name"));
  });
});
