@@ -176,19 +176,6 @@ var _ = Describe("Temporal Types", func() {
176
176
location )
177
177
}
178
178
179
- testReceive := func (query string , expected interface {}) {
180
- result , err = session .Run (query , nil )
181
- Expect (err ).To (BeNil ())
182
-
183
- if result .Next () {
184
- var received = result .Record ().Values [0 ]
185
-
186
- Expect (received ).To (Equal (expected ))
187
- }
188
- Expect (result .Err ()).To (BeNil ())
189
- Expect (result .Next ()).To (BeFalse ())
190
- }
191
-
192
179
testSendAndReceive := func (query string , data interface {}, expected []interface {}) {
193
180
result , err = session .Run (query , map [string ]interface {}{"x" : data })
194
181
Expect (err ).To (BeNil ())
@@ -228,43 +215,6 @@ var _ = Describe("Temporal Types", func() {
228
215
Expect (result .Next ()).To (BeFalse ())
229
216
}
230
217
231
- Context ("Receive" , func () {
232
- It ("duration" , func () {
233
- testReceive ("RETURN duration({ months: 16, days: 45, seconds: 120, nanoseconds: 187309812 })" , neo4j .DurationOf (16 , 45 , 120 , 187309812 ))
234
- })
235
-
236
- It ("date" , func () {
237
- testReceive ("RETURN date({ year: 1994, month: 11, day: 15 })" , neo4j .DateOf (time .Date (1994 , 11 , 15 , 0 , 0 , 0 , 0 , time .Local )))
238
- })
239
-
240
- It ("local time" , func () {
241
- testReceive ("RETURN localtime({ hour: 23, minute: 49, second: 59, nanosecond: 999999999 })" , neo4j .LocalTimeOf (time .Date (0 , 0 , 0 , 23 , 49 , 59 , 999999999 , time .Local )))
242
- })
243
-
244
- It ("offset time" , func () {
245
- testReceive ("RETURN time({ hour: 23, minute: 49, second: 59, nanosecond: 999999999, timezone:'+03:00' })" , neo4j .OffsetTimeOf (time .Date (0 , 0 , 0 , 23 , 49 , 59 , 999999999 , time .FixedZone ("Offset" , 3 * 60 * 60 ))))
246
- })
247
-
248
- It ("local date time (test location = UTC)" , func () {
249
- testReceive ("RETURN localdatetime({ year: 1859, month: 5, day: 31, hour: 23, minute: 49, second: 59, nanosecond: 999999999 })" , neo4j .LocalDateTimeOf (time .Date (1859 , 5 , 31 , 23 , 49 , 59 , 999999999 , time .UTC )))
250
- })
251
-
252
- It ("local date time (test location = local)" , func () {
253
- testReceive ("RETURN localdatetime({ year: 1859, month: 5, day: 31, hour: 23, minute: 49, second: 59, nanosecond: 999999999 })" , neo4j .LocalDateTimeOf (time .Date (1859 , 5 , 31 , 23 , 49 , 59 , 999999999 , time .Local )))
254
- })
255
-
256
- It ("offset date time" , func () {
257
- testReceive ("RETURN datetime({ year: 1859, month: 5, day: 31, hour: 23, minute: 49, second: 59, nanosecond: 999999999, timezone:'+02:30' })" , time .Date (1859 , 5 , 31 , 23 , 49 , 59 , 999999999 , time .FixedZone ("Offset" , 150 * 60 )))
258
- })
259
-
260
- It ("zoned date time" , func () {
261
- location , err := time .LoadLocation ("Europe/London" )
262
- Expect (err ).To (BeNil ())
263
-
264
- testReceive ("RETURN datetime({ year: 1959, month: 5, day: 31, hour: 23, minute: 49, second: 59, nanosecond: 999999999, timezone:'Europe/London' })" , time .Date (1959 , 5 , 31 , 23 , 49 , 59 , 999999999 , location ))
265
- })
266
- })
267
-
268
218
Context ("Send and Receive" , func () {
269
219
It ("duration" , func () {
270
220
data := neo4j .DurationOf (14 , 35 , 75 , 789012587 )
@@ -390,55 +340,6 @@ var _ = Describe("Temporal Types", func() {
390
340
})
391
341
})
392
342
393
- Context ("Send and receive random" , func () {
394
- It ("duration" , func () {
395
- for i := 0 ; i < numberOfRandomValues ; i ++ {
396
- testSendAndReceiveValue (randomDuration ())
397
- }
398
- })
399
-
400
- It ("date" , func () {
401
- for i := 0 ; i < numberOfRandomValues ; i ++ {
402
- testSendAndReceiveValue (randomLocalDate ())
403
- }
404
- })
405
-
406
- It ("local time" , func () {
407
- for i := 0 ; i < numberOfRandomValues ; i ++ {
408
- testSendAndReceiveValue (randomLocalTime ())
409
- }
410
- })
411
-
412
- It ("offset time" , func () {
413
- for i := 0 ; i < numberOfRandomValues ; i ++ {
414
- testSendAndReceiveValue (randomOffsetTime ())
415
- }
416
- })
417
-
418
- It ("local date time" , func () {
419
- for i := 0 ; i < numberOfRandomValues ; i ++ {
420
- testSendAndReceiveValueComp (randomLocalDateTime (), func (x , y interface {}) bool {
421
- x1 := x .(neo4j.LocalDateTime )
422
- y1 := y .(neo4j.LocalDateTime )
423
-
424
- return x1 .Time ().Equal (y1 .Time ())
425
- })
426
- }
427
- })
428
-
429
- It ("offset date time" , func () {
430
- for i := 0 ; i < numberOfRandomValues ; i ++ {
431
- testSendAndReceiveValue (randomOffsetDateTime ())
432
- }
433
- })
434
-
435
- It ("zoned date time" , func () {
436
- for i := 0 ; i < numberOfRandomValues ; i ++ {
437
- testSendAndReceiveValue (randomZonedDateTime ())
438
- }
439
- })
440
- })
441
-
442
343
Context ("Send and receive random arrays" , func () {
443
344
It ("duration" , func () {
444
345
listSize := rand .Intn (1000 )
0 commit comments