Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quellcode-Bibliothek command-tree.test.ts

  Sprache: JAVA
 

import { Command } from "commander";
import { describe, expect, it } from "vitest";
import { removeCommand, removeCommandByName } from "./command-tree.js";

describe("command-tree", () => {
  it("removes a command instance when present", () => {
    const program = new Command();
    const alpha = program.command("alpha");
    program.command("beta");

    expect(removeCommand(program, alpha)).toBe(true);
    expect(program.commands.map((command) => command.name())).toEqual(["beta"]);
  });

  it("returns false when command instance is already absent", () => {
    const program = new Command();
    program.command("alpha");
    const detached = new Command("beta");

    expect(removeCommand(program, detached)).toBe(false);
  });

  it("removes by command name", () => {
    const program = new Command();
    program.command("alpha");
    program.command("beta");

    expect(removeCommandByName(program, "alpha")).toBe(true);
    expect(program.commands.map((command) => command.name())).toEqual(["beta"]);
  });

  it("removes by command alias", () => {
    const program = new Command();
    program.command("alpha").alias("a");
    program.command("beta");

    expect(removeCommandByName(program, "a")).toBe(true);
    expect(program.commands.map((command) => command.name())).toEqual(["beta"]);
  });

  it("returns false when name does not exist", () => {
    const program = new Command();
    program.command("alpha");

    expect(removeCommandByName(program, "missing")).toBe(false);
    expect(program.commands.map((command) => command.name())).toEqual(["alpha"]);
  });
});

Messung V0.5 in Prozent
C=100 H=99 G=99

¤ 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.0.10Bemerkung:  (vorverarbeitet am  2026-06-10) ¤

*Bot Zugriff






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik