mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 11:51:23 +00:00
perf(test): consolidate auth/pty/health mini suites
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { expect, test } from "vitest";
|
||||
import { buildCursorPositionResponse, stripDsrRequests } from "./pty-dsr.js";
|
||||
import {
|
||||
BRACKETED_PASTE_END,
|
||||
BRACKETED_PASTE_START,
|
||||
@@ -38,3 +39,15 @@ test("encodePaste wraps bracketed sequences by default", () => {
|
||||
expect(payload.startsWith(BRACKETED_PASTE_START)).toBe(true);
|
||||
expect(payload.endsWith(BRACKETED_PASTE_END)).toBe(true);
|
||||
});
|
||||
|
||||
test("stripDsrRequests removes cursor queries and counts them", () => {
|
||||
const input = "hi\x1b[6nthere\x1b[?6n";
|
||||
const { cleaned, requests } = stripDsrRequests(input);
|
||||
expect(cleaned).toBe("hithere");
|
||||
expect(requests).toBe(2);
|
||||
});
|
||||
|
||||
test("buildCursorPositionResponse returns CPR sequence", () => {
|
||||
expect(buildCursorPositionResponse()).toBe("\x1b[1;1R");
|
||||
expect(buildCursorPositionResponse(12, 34)).toBe("\x1b[12;34R");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user