import assert from "node:assert/strict";
import * as path from "node:path";
import { describe, it } from "node:test";
import { buildStartupLogFilePath, formatStartupTimestamp, getStartupPathName, sanitizeLogFileNameSegment, } from "./logger.js";
describe("logger startup log path", () => {
    it("formats startup time for log filenames", () => {
        const startupTime = new Date(2026, 4, 5, 9, 8, 7, 6);
        assert.equal(formatStartupTimestamp(startupTime), "20260505-090807-006");
    });
    it("uses the last startup path segment", () => {
        assert.equal(getStartupPathName("D:/code/AgentsWorkStudio/demo-project/"), "demo-project");
        assert.equal(getStartupPathName("D:\\code\\AgentsWorkStudio\\demo-project\\"), "demo-project");
    });
    it("sanitizes unsafe filename characters", () => {
        assert.equal(sanitizeLogFileNameSegment('demo:bad*name?'), "demo_bad_name_");
    });
    it("builds log path under the aws bridge log directory", () => {
        const startupTime = new Date(2026, 4, 5, 9, 8, 7, 6);
        const logFilePath = buildStartupLogFilePath({
            homeDir: "C:/Users/dev",
            startupPath: "D:/code/AgentsWorkStudio/aws-client-agent-mcp",
            startupTime,
        });
        assert.equal(logFilePath, path.join("C:/Users/dev", ".aws-bridge", "log", "aws-client-agent-mcp-20260505-090807-006.log"));
    });
});
//# sourceMappingURL=logger.test.js.map