Files
wehub-resource-sync e4dcfc49aa
Tests / Import Check (Python 3.13) (push) Has been cancelled
Tests / Import Check (Python 3.14) (push) Has been cancelled
Tests / Python Tests (Python 3.11) (push) Has been cancelled
Tests / Python Tests (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.14) (push) Has been cancelled
Tests / Test Summary (push) Has been cancelled
Tests / Lint and Format (push) Has been cancelled
Tests / Web Node Tests (push) Has been cancelled
Tests / Import Check (Python 3.11) (push) Has been cancelled
Tests / Import Check (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.13) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:00:43 +08:00

24 lines
856 B
TypeScript

import test from "node:test";
import assert from "node:assert/strict";
import { normalizeVersionTag } from "../lib/version";
test("normalizeVersionTag accepts bare semver", () => {
assert.equal(normalizeVersionTag("1.4.0"), "v1.4.0");
});
test("normalizeVersionTag keeps the v prefix", () => {
assert.equal(normalizeVersionTag("v1.4.0"), "v1.4.0");
});
test("normalizeVersionTag supports PEP 440-style pre-releases", () => {
assert.equal(normalizeVersionTag("v1.0.0-beta.4"), "v1.0.0-beta.4");
assert.equal(normalizeVersionTag("1.0.0rc1"), "v1.0.0rc1");
});
test("normalizeVersionTag rejects unparseable inputs", () => {
assert.equal(normalizeVersionTag(""), null);
assert.equal(normalizeVersionTag(undefined), null);
assert.equal(normalizeVersionTag("abc1234"), null);
assert.equal(normalizeVersionTag("v1.2.3-5-gabc1234"), null);
});