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

Quelle  emit-notes.test.ts

  Sprache: JAVA
 

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

import { describe, expect, it, vi } from "vitest";
import { emitDoctorNotes } from "./emit-notes.js";

describe("doctor note emission", () => {
  it("emits grouped change and warning notes with the correct titles", () => {
    const note = vi.fn();

    emitDoctorNotes({
      note,
      changeNotes: ["change one", "change two"],
      warningNotes: ["warning one"],
    });

    expect(note.mock.calls).toEqual([
      ["change one", "Doctor changes"],
      ["change two", "Doctor changes"],
      ["warning one", "Doctor warnings"],
    ]);
  });

  it("emits only warning notes when changeNotes is omitted", () => {
    const note = vi.fn();

    emitDoctorNotes({
      note,
      warningNotes: ["warning only"],
    });

    expect(note.mock.calls).toEqual([["warning only", "Doctor warnings"]]);
  });

  it("sanitizes emitted notes from plugin-provided doctor output", () => {
    const note = vi.fn();

    emitDoctorNotes({
      note,
      changeNotes: ["change \u001B[31mred\u001B[0m\nnext line"],
      warningNotes: [
        `warning \u001B]8;;https://example.test\u001B\\link\u001B]8;;\u001B\\${String.fromCharCode(
          0x9b,
        )}\r`,
      ],
    });

    expect(note.mock.calls).toEqual([
      ["change red\nnext line", "Doctor changes"],
      ["warning link", "Doctor warnings"],
    ]);
  });

  it("emits nothing when note groups are omitted or empty", () => {
    const note = vi.fn();

    emitDoctorNotes({ note });
    emitDoctorNotes({ note, changeNotes: [], warningNotes: [] });

    expect(note).not.toHaveBeenCalled();
  });
});

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