macOS: ensure /tmp/clawdbot exists for launchd logs
This commit is contained in:
committed by
Peter Steinberger
parent
5b23f847d6
commit
aaae327563
21
apps/macos/Tests/ClawdbotIPCTests/LogLocatorTests.swift
Normal file
21
apps/macos/Tests/ClawdbotIPCTests/LogLocatorTests.swift
Normal file
@@ -0,0 +1,21 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import Clawdbot
|
||||
|
||||
@Suite struct LogLocatorTests {
|
||||
@Test func launchdGatewayLogPathEnsuresTmpDirExists() throws {
|
||||
let dirPath = "/tmp/clawdbot"
|
||||
let fm = FileManager.default
|
||||
|
||||
// Simulate a clean machine state where /tmp/clawdbot does not exist.
|
||||
if fm.fileExists(atPath: dirPath) {
|
||||
try? fm.removeItem(atPath: dirPath)
|
||||
}
|
||||
|
||||
_ = LogLocator.launchdGatewayLogPath
|
||||
|
||||
var isDir: ObjCBool = false
|
||||
#expect(fm.fileExists(atPath: dirPath, isDirectory: &isDir))
|
||||
#expect(isDir.boolValue == true)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user