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

Quelle  dreaming-shared.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 { includesSystemEventToken } from "./dreaming-shared.js";

const TOKEN = "__openclaw_memory_core_short_term_promotion_dream__";

describe("includesSystemEventToken", () => {
  it("matches the bare token", () => {
    expect(includesSystemEventToken(TOKEN, TOKEN)).toBe(true);
  });

  it("matches a token wrapped by an isolated-cron `[cron:<id>]` prefix", () => {
    expect(includesSystemEventToken(`[cron:abc-123] ${TOKEN}`, TOKEN)).toBe(true);
  });

  it("matches the token on its own line within multiline content", () => {
    expect(includesSystemEventToken(`leading text\n${TOKEN}\ntrailing`, TOKEN)).toBe(true);
  });

  it("does NOT match a user message that merely embeds the token mid-sentence", () => {
    expect(
      includesSystemEventToken(`please tell me about ${TOKEN} when you have time`, TOKEN),
    ).toBe(false);
  });

  it("does NOT match a user message with the token in a code-fence-style block", () => {
    expect(
      includesSystemEventToken(`here is a snippet:\n\`${TOKEN}\`\nwhat does that do?`, TOKEN),
    ).toBe(false);
  });

  it("does NOT match an arbitrary wrapper the runtime does not produce", () => {
    expect(includesSystemEventToken(`[somewrap] ${TOKEN}`, TOKEN)).toBe(false);
  });

  it("returns false for empty inputs", () => {
    expect(includesSystemEventToken("", TOKEN)).toBe(false);
    expect(includesSystemEventToken(TOKEN, "")).toBe(false);
    expect(includesSystemEventToken("   ", TOKEN)).toBe(false);
  });
});

¤ Dauer der Verarbeitung: 0.8 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.