mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
Squash merge of 1,462 upstream commits with openclaw→hanzo-bot naming transforms applied. Conflicts resolved favoring our main branch to preserve existing customizations. Key upstream additions: - iOS Security Stack (concurrency locks, runtime guards, TTS fallback) - Discord CDN hostname allowlisting for SSRF protection - Discord mention handling improvements - Various bug fixes and stability improvements
25 lines
732 B
Swift
25 lines
732 B
Swift
import Darwin
|
|
import Foundation
|
|
import Testing
|
|
@testable import HanzoBot
|
|
|
|
@Suite struct LogLocatorTests {
|
|
@Test func launchdGatewayLogPathEnsuresTmpDirExists() {
|
|
let fm = FileManager()
|
|
let baseDir = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true)
|
|
let logDir = baseDir.appendingPathComponent("hanzo-bot-tests-\(UUID().uuidString)")
|
|
|
|
setenv("BOT_LOG_DIR", logDir.path, 1)
|
|
defer {
|
|
unsetenv("BOT_LOG_DIR")
|
|
try? fm.removeItem(at: logDir)
|
|
}
|
|
|
|
_ = LogLocator.launchdGatewayLogPath
|
|
|
|
var isDir: ObjCBool = false
|
|
#expect(fm.fileExists(atPath: logDir.path, isDirectory: &isDir))
|
|
#expect(isDir.boolValue == true)
|
|
}
|
|
}
|