import { expect, test } from "bun:test";
import { alpha2ToIso3 } from "./country-iso3";

test("mapping alpha2 → alpha3 GSC (minuscule)", () => {
  expect(alpha2ToIso3("FR")).toBe("fra");
  expect(alpha2ToIso3("fr")).toBe("fra");
  expect(alpha2ToIso3("BE")).toBe("bel");
  expect(alpha2ToIso3("CH")).toBe("che");
  expect(alpha2ToIso3("CA")).toBe("can");
  expect(alpha2ToIso3("US")).toBe("usa");
  expect(alpha2ToIso3("GB")).toBe("gbr");
  expect(alpha2ToIso3("DE")).toBe("deu");
  expect(alpha2ToIso3("ES")).toBe("esp");
  expect(alpha2ToIso3("IT")).toBe("ita");
});

test("pays inconnu → null", () => {
  expect(alpha2ToIso3("ZZ")).toBe(null);
  expect(alpha2ToIso3("")).toBe(null);
});
