feat: finished all open things up to and including phase 6

This commit is contained in:
2026-03-21 08:41:13 +01:00
parent 0325fa8964
commit 107ac0524b
9 changed files with 457 additions and 33 deletions

View File

@@ -1,3 +1,4 @@
import MLXLMCommon
import XCTest
@testable import MLX_Server
@@ -15,4 +16,24 @@ final class ImageDecoderTests: XCTestCase {
XCTAssertNotNil(image)
XCTAssertGreaterThanOrEqual(image?.estimatedBytes ?? 0, 4)
}
func testDecodeJPEGDataURI() {
let image = ImageDecoder.decode(TestImageFixtures.primaryJPEGDataURI)
XCTAssertNotNil(image)
XCTAssertGreaterThanOrEqual(image?.estimatedBytes ?? 0, 64 * 64 * 4)
}
func testDecodeLarge4KDataURI() throws {
let image = try XCTUnwrap(ImageDecoder.decode(TestImageFixtures.largeDataURI))
XCTAssertGreaterThanOrEqual(image.estimatedBytes, 4_096 * 4_096 * 4)
if case .ciImage(let ciImage) = image.image {
XCTAssertEqual(Int(ciImage.extent.width), 4_096)
XCTAssertEqual(Int(ciImage.extent.height), 4_096)
} else {
XCTFail("Expected CIImage-backed decoded image")
}
}
}