mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-27 18:00:41 +00:00
Gateway tests: cover chat stop parsing variants
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import {
|
||||
abortChatRunById,
|
||||
isChatStopCommandText,
|
||||
type ChatAbortOps,
|
||||
type ChatAbortControllerEntry,
|
||||
} from "./chat-abort.js";
|
||||
@@ -42,6 +43,20 @@ function createOps(params: {
|
||||
};
|
||||
}
|
||||
|
||||
describe("isChatStopCommandText", () => {
|
||||
it("matches slash and standalone multilingual stop forms", () => {
|
||||
expect(isChatStopCommandText(" /STOP!!! ")).toBe(true);
|
||||
expect(isChatStopCommandText("stop please")).toBe(true);
|
||||
expect(isChatStopCommandText("停止")).toBe(true);
|
||||
expect(isChatStopCommandText("やめて")).toBe(true);
|
||||
expect(isChatStopCommandText("توقف")).toBe(true);
|
||||
expect(isChatStopCommandText("stopp")).toBe(true);
|
||||
expect(isChatStopCommandText("pare")).toBe(true);
|
||||
expect(isChatStopCommandText("/status")).toBe(false);
|
||||
expect(isChatStopCommandText("keep going")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("abortChatRunById", () => {
|
||||
it("broadcasts aborted payload with partial message when buffered text exists", () => {
|
||||
const runId = "run-1";
|
||||
|
||||
Reference in New Issue
Block a user