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

Quelle  models-config.file-mode.test.ts

  Sprache: JAVA
 

import fs from "node:fs/promises";
import path from "node:path";
import { afterEach, describe, expect, it } from "vitest";
import { cleanupTempDirs, makeTempDir } from "../../test/helpers/temp-dir.js";
import {
  ensureModelsFileModeForModelsJson,
  writeModelsFileAtomicForModelsJson,
} from "./models-config.js";

const tempDirs = new Set<string>();

afterEach(() => {
  cleanupTempDirs(tempDirs);
});

describe("models-config file mode", () => {
  it("writes models.json with mode 0600", async () => {
    if (process.platform === "win32") {
      return;
    }
    const dir = makeTempDir(tempDirs, "models-json-mode-");
    const modelsPath = path.join(dir, "models.json");
    await writeModelsFileAtomicForModelsJson(modelsPath, '{"providers":{}}\n');
    const stat = await fs.stat(modelsPath);
    expect(stat.mode & 0o777).toBe(0o600);
  });

  it("repairs models.json mode to 0600 on no-content-change paths", async () => {
    if (process.platform === "win32") {
      return;
    }
    const dir = makeTempDir(tempDirs, "models-json-mode-");
    const modelsPath = path.join(dir, "models.json");
    await writeModelsFileAtomicForModelsJson(modelsPath, '{"providers":{}}\n');
    await fs.chmod(modelsPath, 0o644);

    await ensureModelsFileModeForModelsJson(modelsPath);

    const stat = await fs.stat(modelsPath);
    expect(stat.mode & 0o777).toBe(0o600);
  });
});

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

¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet am  2026-06-10) ¤

*© Formatika GbR, Deutschland






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.