mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
23 lines
918 B
Swift
23 lines
918 B
Swift
import Foundation
|
|
import Testing
|
|
@testable import OpenClaw
|
|
|
|
@Suite struct KeychainStoreTests {
|
|
@Test func saveLoadUpdateDeleteRoundTrip() {
|
|
let service = "bot.molt.tests.\(UUID().uuidString)"
|
|
let account = "value"
|
|
|
|
#expect(KeychainStore.delete(service: service, account: account))
|
|
#expect(KeychainStore.loadString(service: service, account: account) == nil)
|
|
|
|
#expect(KeychainStore.saveString("first", service: service, account: account))
|
|
#expect(KeychainStore.loadString(service: service, account: account) == "first")
|
|
|
|
#expect(KeychainStore.saveString("second", service: service, account: account))
|
|
#expect(KeychainStore.loadString(service: service, account: account) == "second")
|
|
|
|
#expect(KeychainStore.delete(service: service, account: account))
|
|
#expect(KeychainStore.loadString(service: service, account: account) == nil)
|
|
}
|
|
}
|