mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
Comprehensive rename of all openclaw references to hanzo-bot equivalents: - Package: openclaw → @hanzo/bot - Binary: openclaw → hanzo-bot - Types: OpenClaw* → Bot* - Env vars: OPENCLAW_* → BOT_* - Android: ai.openclaw.android → ai.hanzo.bot.android - iOS/macOS: ai.openclaw.* → ai.hanzo.* - Swift modules: OpenClaw* → Bot* - Plugins: openclaw.plugin.json → bot.plugin.json - Paths: .openclaw/ → .hanzo/bot/ - URLs: github.com/openclaw → github.com/hanzoai
47 lines
1.4 KiB
Swift
47 lines
1.4 KiB
Swift
import Foundation
|
|
import Testing
|
|
@testable import HanzoBot
|
|
|
|
@Suite(.serialized)
|
|
struct NixModeStableSuiteTests {
|
|
@Test func resolvesFromStableSuiteForAppBundles() {
|
|
let suite = UserDefaults(suiteName: launchdLabel)!
|
|
let key = "bot.nixMode"
|
|
let prev = suite.object(forKey: key)
|
|
defer {
|
|
if let prev { suite.set(prev, forKey: key) } else { suite.removeObject(forKey: key) }
|
|
}
|
|
|
|
suite.set(true, forKey: key)
|
|
|
|
let standard = UserDefaults(suiteName: "NixModeStableSuiteTests.\(UUID().uuidString)")!
|
|
#expect(!standard.bool(forKey: key))
|
|
|
|
let resolved = ProcessInfo.resolveNixMode(
|
|
environment: [:],
|
|
standard: standard,
|
|
stableSuite: suite,
|
|
isAppBundle: true)
|
|
#expect(resolved)
|
|
}
|
|
|
|
@Test func ignoresStableSuiteOutsideAppBundles() {
|
|
let suite = UserDefaults(suiteName: launchdLabel)!
|
|
let key = "bot.nixMode"
|
|
let prev = suite.object(forKey: key)
|
|
defer {
|
|
if let prev { suite.set(prev, forKey: key) } else { suite.removeObject(forKey: key) }
|
|
}
|
|
|
|
suite.set(true, forKey: key)
|
|
let standard = UserDefaults(suiteName: "NixModeStableSuiteTests.\(UUID().uuidString)")!
|
|
|
|
let resolved = ProcessInfo.resolveNixMode(
|
|
environment: [:],
|
|
standard: standard,
|
|
stableSuite: suite,
|
|
isAppBundle: false)
|
|
#expect(!resolved)
|
|
}
|
|
}
|