mirror of
https://github.com/hanzoai/bot.git
synced 2026-11-01 07:38:30 +00:00
Automated rebrand of all openclaw references to hanzo bot: - Package: openclaw -> @hanzo/bot - Binary: openclaw -> hanzo-bot - Config: ~/.openclaw -> ~/.hanzo/bot - Docker: ghcr.io/hanzoai/bot - Env vars: OPENCLAW_* -> BOT_* - Bundle IDs: ai.hanzo.bot.* - Product name: Hanzo Bot
21 lines
628 B
Swift
21 lines
628 B
Swift
import Foundation
|
|
import Testing
|
|
@testable import Hanzo Bot
|
|
|
|
struct ScreenshotSizeTests {
|
|
@Test
|
|
func `read PNG size returns dimensions`() throws {
|
|
let pngBase64 =
|
|
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+WZxkAAAAASUVORK5CYII="
|
|
let data = try #require(Data(base64Encoded: pngBase64))
|
|
let size = ScreenshotSize.readPNGSize(data: data)
|
|
#expect(size?.width == 1)
|
|
#expect(size?.height == 1)
|
|
}
|
|
|
|
@Test
|
|
func `read PNG size rejects non PNG data`() {
|
|
#expect(ScreenshotSize.readPNGSize(data: Data("nope".utf8)) == nil)
|
|
}
|
|
}
|