Files
Netcatty/electron/bridges/terminalReportSequence.test.cjs
T
陈大猫andryan-wong-coder 67f8108713 feat(plugins): add reviewed privileged terminal data pipeline (#2402)
* feat(plugins): add privileged terminal data pipeline

* fix(plugins): harden terminal interceptor lifecycle

* fix(plugins): close terminal interceptor lifecycle gaps

* fix(plugins): preserve terminal interceptor state transitions

* fix(plugin): close terminal pipeline lifecycle gaps

* fix(plugin): harden terminal interceptor startup

* fix(plugin): isolate terminal output route attempts

* fix(plugin): isolate reused terminal sessions

* fix(plugin): harden terminal interceptor boundaries

* fix(plugin): harden terminal replay metadata

* fix(plugin): preserve terminal replay provenance

* fix(plugin): close terminal pipeline lifecycle races

* fix(plugin): harden terminal route handoff

* fix(plugin): contain terminal handoff failures

* fix(plugin): route terminal attachment through RPC

* fix(plugin): validate terminal attachment RPC

* fix(plugin): close unexpected runtime ports

* fix(plugin): canonicalize terminal data frames

* fix(plugin): close terminal pipeline lifecycle gaps

* fix(plugin): close terminal interceptor review gaps

* fix(plugin): harden terminal interceptor protocol handling

* fix(plugin): preserve terminal flow compatibility

* fix(plugin): preserve terminal protocol accounting

* fix(plugin): bound terminal interceptor lifecycle

* fix(plugin): close terminal interceptor review gaps

---------

Co-authored-by: ryan-wong-coder <wangsiyuan19990317@gmail.com>
2026-07-23 09:42:47 +08:00

30 lines
895 B
JavaScript

"use strict";
const assert = require("node:assert/strict");
const test = require("node:test");
const { isTerminalReportSequence } = require("./terminalReportSequence.cjs");
test("recognizes terminal-generated report families without classifying ordinary input", () => {
for (const report of [
"\x1b[I",
"\x1b[1;2R",
"\x1b[?1;2c",
"\x1b[?997;1n",
"\x1b[?3u",
"\x1b[?2004;1$y",
"\x1b[8;24;80t",
"\x1b[4;1080;1920t",
"\x1b]10;rgb:ffff/ffff/ffff\x1b\\",
"\x1b]4;255;rgb:ffff/0000/ffff\x1b\\",
"\x1b]11;rgb:0000/0000/0000\x07",
"\x1b]4;7;rgb:1111/2222/3333\x07",
"\x1bP1$r0m\x1b\\",
]) {
assert.equal(isTerminalReportSequence(report), true, JSON.stringify(report));
}
for (const input of ["hello", "\r", "\x1b[A", "\x1b[200~paste\x1b[201~"]) {
assert.equal(isTerminalReportSequence(input), false, JSON.stringify(input));
}
});