feat: vision properly coverd with tests and completed

This commit is contained in:
2026-03-20 12:57:27 +01:00
parent e59be9df1a
commit 0761254d17
12 changed files with 648 additions and 40 deletions

View File

@@ -0,0 +1,30 @@
import Foundation
enum TestImageFixtures {
private static let repoRoot: URL = {
URL(fileURLWithPath: #filePath)
.deletingLastPathComponent()
.deletingLastPathComponent()
.deletingLastPathComponent()
}()
private static func loadBase64(named name: String) -> String {
let url = repoRoot
.appendingPathComponent("MLXServer")
.appendingPathComponent("Assets.xcassets")
.appendingPathComponent("AppIcon.appiconset")
.appendingPathComponent(name)
guard let data = try? Data(contentsOf: url) else {
fatalError("Missing image fixture at \(url.path)")
}
return data.base64EncodedString()
}
static let primaryPNGBase64 = loadBase64(named: "icon_16x16.png")
static let alternatePNGBase64 = loadBase64(named: "icon_32x32.png")
static let primaryDataURI = "data:image/png;base64,\(primaryPNGBase64)"
static let alternateDataURI = "data:image/png;base64,\(alternatePNGBase64)"
}