Files
openclaw/extensions/irc/src/control-chars.test.ts
Peter Steinberger 074f07c520 refactor(irc,workboard): trim internal exports (#107749)
* refactor(irc): privatize internal plugin surfaces

* refactor(workboard): privatize internal plugin surfaces

* chore(deadcode): refresh unused-export baseline
2026-07-14 13:19:08 -07:00

18 lines
784 B
TypeScript

// Irc tests cover control chars plugin behavior.
import { describe, expect, it } from "vitest";
import { hasIrcControlChars, stripIrcControlChars } from "./control-chars.js";
describe("irc control char helpers", () => {
it("detects IRC control characters without classifying spaces as control text", () => {
expect(hasIrcControlChars("\u0000hello\u001f")).toBe(true);
expect(hasIrcControlChars("hello\u007f")).toBe(true);
expect(hasIrcControlChars("hello world")).toBe(false);
});
it("detects and strips IRC control characters from strings", () => {
expect(hasIrcControlChars("hello\u0002world")).toBe(true);
expect(hasIrcControlChars("hello world")).toBe(false);
expect(stripIrcControlChars("he\u0002llo\u007f world")).toBe("hello world");
});
});