Files
openclaw/src/cli/error-format.test.ts
Peter Steinberger a9582a1bb6 fix: keep bounded text truncation UTF-16 safe (#101654)
* 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>
2026-07-07 13:44:32 +01:00

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");
});
});