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


Quelle  ipv4.test.ts

  Sprache: JAVA
 

import { describe, expect, it } from "vitest";
import { validateDottedDecimalIPv4Input, validateIPv4AddressInput } from "./ipv4.js";

describe("shared/net/ipv4", () => {
  it("requires a value for custom bind mode", () => {
    expect(validateDottedDecimalIPv4Input(undefined)).toBe(
      "IP address is required for custom bind mode",
    );
    expect(validateDottedDecimalIPv4Input("")).toBe("IP address is required for custom bind mode");
    expect(validateDottedDecimalIPv4Input("   ")).toBe(
      "Invalid IPv4 address (e.g., 192.168.1.100)",
    );
  });

  it("accepts canonical dotted-decimal ipv4 only", () => {
    expect(validateDottedDecimalIPv4Input("0.0.0.0")).toBeUndefined();
    expect(validateDottedDecimalIPv4Input("192.168.1.100")).toBeUndefined();
    expect(validateDottedDecimalIPv4Input(" 192.168.1.100 ")).toBeUndefined();
    expect(validateDottedDecimalIPv4Input("0177.0.0.1")).toBe(
      "Invalid IPv4 address (e.g., 192.168.1.100)",
    );
    expect(validateDottedDecimalIPv4Input("[192.168.1.100]")).toBeUndefined();
    expect(validateDottedDecimalIPv4Input("127.1")).toBe(
      "Invalid IPv4 address (e.g., 192.168.1.100)",
    );
    expect(validateDottedDecimalIPv4Input("example.com")).toBe(
      "Invalid IPv4 address (e.g., 192.168.1.100)",
    );
  });

  it("keeps the backward-compatible alias wired to the same validation", () => {
    expect(validateIPv4AddressInput("192.168.1.100")).toBeUndefined();
    expect(validateIPv4AddressInput("bad-ip")).toBe("Invalid IPv4 address (e.g., 192.168.1.100)");
  });
});

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

¤ Dauer der Verarbeitung: 0.8 Sekunden  ¤

*© 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge