mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-25 04:07:47 +00:00
... except in projects that use CocoaPods, because well the new Xcode project format is not supporteed
29 lines
803 B
Swift
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)
|
|
}
|
|
}
|
|
}
|