// Task 602 — cloudflared.slice unit emitted at install time.
// Every cloudflared-<brand>.scope spawned by resume-tunnel.sh drops under
// this slice for cohort observability via `systemctl --user status cloudflared.slice`.
import test from "node:test";
import assert from "node:assert/strict";
import { buildCloudflaredSliceUnitFile } from "../port-resolution.js";
test("buildCloudflaredSliceUnitFile emits a valid systemd slice unit", () => {
    const unit = buildCloudflaredSliceUnitFile();
    assert.match(unit, /^\[Unit\]$/m);
    assert.match(unit, /^Description=Cloudflare tunnel scopes \(Task 602\)$/m);
    assert.match(unit, /^\[Slice\]$/m);
    assert.match(unit, /^\[Install\]$/m);
    assert.match(unit, /^WantedBy=default\.target$/m);
});
test("buildCloudflaredSliceUnitFile output has no per-brand template tokens", () => {
    const unit = buildCloudflaredSliceUnitFile();
    assert.doesNotMatch(unit, /\$\{/);
    assert.doesNotMatch(unit, /__[A-Z_]+__/);
});
