mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-17 21:31:36 +00:00
* fix: keep bounded text UTF-16 safe Co-authored-by: wm0018 <wu.min5@xydigit.com> Co-authored-by: 廖石荣 0668000909 <liao.shirong@xydigit.com> Co-authored-by: 0668000787 <ma.weibin@xydigit.com> * chore: keep UTF-16 release note in PR body --------- Co-authored-by: wm0018 <wu.min5@xydigit.com> Co-authored-by: 廖石荣 0668000909 <liao.shirong@xydigit.com> Co-authored-by: 0668000787 <ma.weibin@xydigit.com>
14 lines
473 B
TypeScript
14 lines
473 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { formatStrictJsonParseFailure } from "./error-format.js";
|
|
|
|
describe("formatStrictJsonParseFailure", () => {
|
|
it("keeps the bounded JSON preview UTF-16 well-formed", () => {
|
|
const value = `${"x".repeat(44)}🚀tail`;
|
|
|
|
const message = formatStrictJsonParseFailure({ value, cause: "invalid token" });
|
|
|
|
expect(message).toContain(`${"x".repeat(44)}...`);
|
|
expect(message).not.toContain("\uD83D");
|
|
});
|
|
});
|