@@ -210,6 +210,28 @@ class FluentPostgreSQLTests: XCTestCase {
210
210
try benchmarker. benchmarkContains_withSchema ( )
211
211
}
212
212
213
+ func testGH30( ) throws {
214
+ /// - types
215
+ struct Foo : PostgreSQLModel , Migration {
216
+ static let entity = " foos "
217
+ var id : Int ?
218
+ var location : PostgreSQLPoint ?
219
+ }
220
+
221
+ /// - prepare db
222
+ benchmarker. database. enableLogging ( using: . print)
223
+ let conn = try benchmarker. pool. requestConnection ( ) . wait ( )
224
+ defer { try ? Foo . revert ( on: conn) . wait ( ) }
225
+ try Foo . prepare ( on: conn) . wait ( )
226
+
227
+ /// - tests
228
+ var foo = Foo ( id: nil , location: PostgreSQLPoint ( x: 1 , y: 3.14 ) )
229
+ foo = try foo. save ( on: conn) . wait ( )
230
+ foo = try Foo . find ( foo. requireID ( ) , on: conn) . wait ( ) !
231
+ XCTAssertEqual ( foo. location? . x, 1 )
232
+ XCTAssertEqual ( foo. location? . y, 3.14 )
233
+ }
234
+
213
235
static let allTests = [
214
236
( " testSchema " , testSchema) ,
215
237
( " testModels " , testModels) ,
@@ -228,6 +250,7 @@ class FluentPostgreSQLTests: XCTestCase {
228
250
( " testGH21 " , testGH21) ,
229
251
( " testPersistsDateMillisecondPart " , testPersistsDateMillisecondPart) ,
230
252
( " testContains " , testContains) ,
253
+ ( " testGH30 " , testGH30) ,
231
254
]
232
255
}
233
256
0 commit comments