mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-18 20:24:47 +00:00
fix: make A2UI hash ordering deterministic
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
compareNormalizedPaths,
|
||||
getLocalRolldownCliCandidates,
|
||||
isBundleHashInputPath,
|
||||
} from "../../scripts/bundle-a2ui.mjs";
|
||||
@@ -36,4 +37,15 @@ describe("scripts/bundle-a2ui.mjs", () => {
|
||||
path.join(repoRoot, "node_modules", "rolldown", "bin", "cli.mjs"),
|
||||
);
|
||||
});
|
||||
|
||||
it("sorts hash inputs without locale-dependent collation", () => {
|
||||
const paths = ["repo/Z.ts", "repo/a.ts", "repo/ä.ts", "repo/A.ts"];
|
||||
|
||||
expect([...paths].toSorted(compareNormalizedPaths)).toEqual([
|
||||
"repo/A.ts",
|
||||
"repo/Z.ts",
|
||||
"repo/a.ts",
|
||||
"repo/ä.ts",
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user