Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/JAVA/Openclaw/src/shared/   (KI Agentensystem Version 22©)  Datei vom 26.3.2026 mit Größe 1 kB image not shown  

Quelle  chat-envelope.test.ts

  Sprache: JAVA
 

Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

import { describe, expect, it } from "vitest";
import { stripEnvelope, stripMessageIdHints } from "./chat-envelope.js";

describe("shared/chat-envelope", () => {
  it("strips recognized channel and timestamp envelope prefixes only", () => {
    expect(stripEnvelope("[WhatsApp 2026-01-24 13:36] hello")).toBe("hello");
    expect(stripEnvelope("[Google Chat room] hello")).toBe("hello");
    expect(stripEnvelope("[2026-01-24T13:36Z] hello")).toBe("hello");
    expect(stripEnvelope("[2026-01-24 13:36] hello")).toBe("hello");
    expect(stripEnvelope("[Custom Sender] hello")).toBe("[Custom Sender] hello");
  });

  it("keeps non-envelope headers and preserves unmatched text", () => {
    expect(stripEnvelope("hello")).toBe("hello");
    expect(stripEnvelope("[note] hello")).toBe("[note] hello");
    expect(stripEnvelope("[2026/01/24 13:36] hello")).toBe("[2026/01/24 13:36] hello");
    expect(stripEnvelope("[Teams] hello")).toBe("[Teams] hello");
  });

  it("removes standalone message id hint lines but keeps inline mentions", () => {
    expect(stripMessageIdHints("hello\n[message_id: abc123]")).toBe("hello");
    expect(stripMessageIdHints("hello\n [message_id: abc123] \nworld")).toBe("hello\nworld");
    expect(stripMessageIdHints("[message_id: abc123]\nhello")).toBe("hello");
    expect(stripMessageIdHints("[message_id: abc123]")).toBe("");
    expect(stripMessageIdHints("hello\r\n[MESSAGE_ID: abc123]\r\nworld")).toBe("hello\nworld");
    expect(stripMessageIdHints("I typed [message_id: abc123] inline")).toBe(
      "I typed [message_id: abc123] inline",
    );
  });
});

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet am  2026-04-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.