29 lines
1.2 KiB
Swift
29 lines
1.2 KiB
Swift
import Foundation
|
|
import Testing
|
|
@testable import SprachmittlerOllama
|
|
|
|
@Test func moduleLinks() {
|
|
#expect(SprachmittlerOllamaModule.moduleName == "SprachmittlerOllama")
|
|
}
|
|
|
|
/// T1.1: the recorded Ollama fixtures are bundled with the test target.
|
|
@Test func recordedFixturesAreBundled() throws {
|
|
let base = try #require(Bundle.module.resourceURL).appendingPathComponent("Fixtures")
|
|
let names = ["version.json", "tags.json", "capture-meta.json"]
|
|
for name in names {
|
|
let url = base.appendingPathComponent(name)
|
|
#expect(FileManager.default.fileExists(atPath: url.path), "missing fixture \(name)")
|
|
}
|
|
let chats = try FileManager.default.contentsOfDirectory(atPath: base.path)
|
|
.filter { $0.hasPrefix("chat-") && $0.hasSuffix(".ndjson") }
|
|
#expect(!chats.isEmpty)
|
|
}
|
|
|
|
@Test func recordedVersionIsDecodable() throws {
|
|
let base = try #require(Bundle.module.resourceURL).appendingPathComponent("Fixtures")
|
|
let data = try Data(contentsOf: base.appendingPathComponent("version.json"))
|
|
let object = try #require(try JSONSerialization.jsonObject(with: data) as? [String: Any])
|
|
let version = try #require(object["version"] as? String)
|
|
#expect(!version.isEmpty)
|
|
}
|