Files
GRDB.swift/Tests/GRDBTests/Support/CGFloatTests.swift
Gwendal Roué 97f517a660 Use Xcode folders
... except in projects that use CocoaPods, because well the new Xcode project format is not supporteed
2026-05-31 23:57:01 +02:00

29 lines
803 B
Swift

import XCTest
import GRDB
#if canImport(CoreGraphics)
import CoreGraphics
#elseif !canImport(Darwin)
import Foundation
#endif
class CGFloatTests: GRDBTestCase {
func testCGFLoat() throws {
let dbQueue = try makeDatabaseQueue()
try dbQueue.inDatabase { db in
try db.execute(sql: "CREATE TABLE points (x DOUBLE, y DOUBLE)")
let x: CGFloat = 1
let y: CGFloat? = nil
try db.execute(sql: "INSERT INTO points VALUES (?,?)", arguments: [x, y])
let row = try Row.fetchOne(db, sql: "SELECT * FROM points")!
let fetchedX: CGFloat = row["x"]
let fetchedY: CGFloat? = row["y"]
XCTAssertEqual(x, fetchedX)
XCTAssertTrue(fetchedY == nil)
}
}
}