"use strict";
var import_dynamicId = require("./dynamicId");
const cases = [];
function test(name, run) {
  cases.push({ name, run });
}
function assertTrue(v, msg) {
  if (!v) throw new Error(msg);
}
function assertFalse(v, msg) {
  if (v) throw new Error(msg);
}
test("isDynamicId: react-aria prefix", () => {
  assertTrue((0, import_dynamicId.isDynamicId)("react-aria9765209213-_r_nj_"), "react-aria");
});
test("isDynamicId: mui prefix", () => {
  assertTrue((0, import_dynamicId.isDynamicId)("mui-6"), "mui-6");
});
test("isDynamicId: Angular Material mat-input", () => {
  assertTrue((0, import_dynamicId.isDynamicId)("mat-input-3"), "mat-input-3");
  assertTrue((0, import_dynamicId.isDynamicId)("cdk-overlay-0"), "cdk-overlay-0");
});
test("isDynamicId: generic numeric suffix after separator", () => {
  assertTrue((0, import_dynamicId.isDynamicId)("item-42"), "item-42");
  assertTrue((0, import_dynamicId.isDynamicId)("row_123"), "row_123");
});
test("isDynamicId: mid-string counter", () => {
  assertTrue((0, import_dynamicId.isDynamicId)("_commonPopup27_iframe"), "_commonPopup27_iframe");
});
test("isDynamicId: pure numeric", () => {
  assertTrue((0, import_dynamicId.isDynamicId)("12345"), "12345");
});
test("isDynamicId: long numeric sequence suffix", () => {
  assertTrue((0, import_dynamicId.isDynamicId)("dropdown99924304"), "dropdown99924304");
});
test("isDynamicId: long hex suffix", () => {
  assertTrue((0, import_dynamicId.isDynamicId)("component-a3f2b1"), "component-a3f2b1");
});
test("isDynamicId: short hex suffix with digit", () => {
  assertTrue((0, import_dynamicId.isDynamicId)("input-093d"), "input-093d");
  assertTrue((0, import_dynamicId.isDynamicId)("input-1a98"), "input-1a98");
});
test("isDynamicId: trailing 3+ digits after letter without separator", () => {
  assertTrue((0, import_dynamicId.isDynamicId)("checkbox877"), "checkbox877");
  assertTrue((0, import_dynamicId.isDynamicId)("button123"), "button123");
});
test("isDynamicId: colon ID (Radix UI)", () => {
  assertTrue((0, import_dynamicId.isDynamicId)("radix-:ra2:"), "radix-:ra2:");
  assertTrue((0, import_dynamicId.isDynamicId)("radix-:r0:"), "radix-:r0:");
});
test("isDynamicId: Vue Tables 2 search pattern", () => {
  assertTrue((0, import_dynamicId.isDynamicId)("VueTables__search_abcde"), "VueTables__search");
});
test("isDynamicId: stable kebab-case names are not dynamic", () => {
  assertFalse((0, import_dynamicId.isDynamicId)("vt-trigger"), "vt-trigger");
  assertFalse((0, import_dynamicId.isDynamicId)("toast-region"), "toast-region");
  assertFalse((0, import_dynamicId.isDynamicId)("ga_workflow-list"), "ga_workflow-list");
  assertFalse((0, import_dynamicId.isDynamicId)("mui-component-select-role"), "mui-component-select-role");
});
test("isDynamicId: short hex suffix without digit is not dynamic", () => {
  assertFalse((0, import_dynamicId.isDynamicId)("item-bad"), "item-bad (all letters)");
  assertFalse((0, import_dynamicId.isDynamicId)("item-fee"), "item-fee (all letters)");
});
test("isDynamicId: single trailing digit after letter is not dynamic", () => {
  assertFalse((0, import_dynamicId.isDynamicId)("item1"), "item1 (single digit)");
  assertFalse((0, import_dynamicId.isDynamicId)("item12"), "item12 (2 digits, below 3-digit threshold)");
});
let failed = 0;
for (const { name, run } of cases) {
  try {
    run();
    console.log("  \u2713", name);
  } catch (e) {
    failed++;
    console.log("  \u2717", name);
    console.log("     ", e.message);
  }
}
if (failed > 0) {
  console.log(`
${failed}/${cases.length} failed`);
  process.exit(1);
}
console.log(`
${cases.length} passed`);
