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

@@ -2,17 +2,15 @@ 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)")
let image = ImageDecoder.decode(TestImageFixtures.primaryDataURI)
XCTAssertNotNil(image)
XCTAssertGreaterThanOrEqual(image?.estimatedBytes ?? 0, 4)
}
func testDecodePlainBase64() {
let image = ImageDecoder.decode(onePixelPNGBase64)
let image = ImageDecoder.decode(TestImageFixtures.primaryPNGBase64)
XCTAssertNotNil(image)
XCTAssertGreaterThanOrEqual(image?.estimatedBytes ?? 0, 4)