Implement session cache upgrade phase 1 foundation

This commit is contained in:
2026-03-20 08:35:37 +01:00
parent 41199cb9bc
commit e98e5fd88b
14 changed files with 552 additions and 34 deletions

View File

@@ -0,0 +1,20 @@
import XCTest
@testable import MLX_Server
final class ImageDecoderTests: XCTestCase {
private let onePixelPNGBase64 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAFgwJ/lRyXWQAAAABJRU5ErkJggg=="
func testDecodeDataURI() {
let image = ImageDecoder.decode("data:image/png;base64,\(onePixelPNGBase64)")
XCTAssertNotNil(image)
XCTAssertGreaterThanOrEqual(image?.estimatedBytes ?? 0, 4)
}
func testDecodePlainBase64() {
let image = ImageDecoder.decode(onePixelPNGBase64)
XCTAssertNotNil(image)
XCTAssertGreaterThanOrEqual(image?.estimatedBytes ?? 0, 4)
}
}