guardia-messenger/node_modules/expo-modules-core/ios/Tests/FunctionWithConvertiblesSpec.swift
DESKTOP-TKLFCPRython f29f525c77 refactor: 101.79.17.164 → zioinfo.co.kr 전체 도메인 변환 + Manager UI 배포
- 37개 파일 IP → zioinfo.co.kr 치환 (소스/매뉴얼/설정/하네스)
- Manager DrConsole/NetworkConsole/CsapConsole 빌드 + /var/www/manager/ 배포
- 테스트: Manager HTTP 200, ITSM 신규 API 7개 전체 200

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 10:09:17 +09:00

66 lines
2.1 KiB
Swift

// Copyright 2018-present 650 Industries. All rights reserved.
import CoreGraphics
import ExpoModulesTestCore
@testable import ExpoModulesCore
class FunctionWithConvertiblesSpec: ExpoSpec {
override class func spec() {
let appContext = AppContext()
let functionName = "function"
it("converts arguments to CoreGraphics types") {
let x = 18.3
let y = -4.1
let width = 734.6
let height = 592.1
mockModuleHolder(appContext) {
AsyncFunction(functionName) { (point: CGPoint, size: CGSize, vector: CGVector, rect: CGRect) in
expect(point.x) == x
expect(point.y) == y
expect(size.width) == width
expect(size.height) == height
expect(vector.dx) == x
expect(vector.dy) == y
expect(rect.origin.x) == x
expect(rect.origin.y) == y
expect(rect.width) == width
expect(rect.height) == height
}
}
.callSync(function: functionName, args: [
[x, y], // point
["width": width, "height": height], // size
["dx": x, "dy": y], // vector
[x, y, width, height] // rect
])
}
it("converts arguments to CGColor") {
func testColorComponents(_ color: CGColor, _ red: CGFloat, _ green: CGFloat, _ blue: CGFloat, _ alpha: CGFloat) {
expect(color.components?[0]) == red / 255.0
expect(color.components?[1]) == green / 255.0
expect(color.components?[2]) == blue / 255.0
expect(color.components?[3]) == alpha / 255.0
}
mockModuleHolder(appContext) {
AsyncFunction(functionName) { (color1: CGColor, color2: CGColor, color3: CGColor, color4: CGColor) in
testColorComponents(color1, 0x2A, 0x4B, 0x5D, 0xFF)
testColorComponents(color2, 0x11, 0xFF, 0x00, 0xDD)
testColorComponents(color3, 0x66, 0x00, 0xCC, 0xAA)
testColorComponents(color4, 0x00, 0x00, 0x00, 0x00)
}
}
.callSync(function: functionName, args: [
"#2A4B5D",
0xDD11FF00,
"60CA",
0
])
}
}
}