17
17
* limitations under the License.
18
18
*/
19
19
20
- import neo4j from '../../src/v1' ;
21
- import { int } from '../../src/v1/integer' ;
20
+ import neo4j from '../../src' ;
22
21
import sharedNeo4j from '../internal/shared-neo4j' ;
23
22
import { ServerVersion , VERSION_3_4_0 } from '../../src/v1/internal/server-version' ;
24
23
import timesSeries from 'async/timesSeries' ;
25
24
import _ from 'lodash' ;
26
- import {
27
- CypherDate ,
28
- CypherDateTimeWithZoneId ,
29
- CypherDateTimeWithZoneOffset ,
30
- CypherDuration ,
31
- CypherLocalDateTime ,
32
- CypherLocalTime ,
33
- CypherTime
34
- } from '../../src/v1/temporal-types' ;
35
25
36
26
const RANDOM_VALUES_TO_TEST = 2000 ;
37
27
const MAX_NANO_OF_SECOND = 999999999 ;
@@ -443,40 +433,40 @@ describe('temporal-types', () => {
443
433
}
444
434
445
435
function randomDateTimeWithZoneOffset ( ) {
446
- return new CypherDateTimeWithZoneOffset (
436
+ return new neo4j . CypherDateTimeWithZoneOffset (
447
437
randomLocalDateTime ( ) ,
448
438
randomZoneOffsetSeconds ( )
449
439
) ;
450
440
}
451
441
452
442
function randomDateTimeWithZoneId ( ) {
453
- return new CypherDateTimeWithZoneId (
443
+ return new neo4j . CypherDateTimeWithZoneId (
454
444
randomLocalDateTime ( ) ,
455
445
randomZoneId ( )
456
446
) ;
457
447
}
458
448
459
449
function randomLocalDateTime ( ) {
460
- return new CypherLocalDateTime ( randomDate ( ) , randomLocalTime ( ) ) ;
450
+ return new neo4j . CypherLocalDateTime ( randomDate ( ) , randomLocalTime ( ) ) ;
461
451
}
462
452
463
453
function randomDate ( ) {
464
- return new CypherDate (
454
+ return new neo4j . CypherDate (
465
455
randomInt ( MIN_YEAR , MAX_YEAR ) ,
466
456
randomInt ( 1 , 12 ) ,
467
457
randomInt ( 1 , 28 )
468
458
) ;
469
459
}
470
460
471
461
function randomTime ( ) {
472
- return new CypherTime (
462
+ return new neo4j . CypherTime (
473
463
randomLocalTime ( ) ,
474
464
randomZoneOffsetSeconds ( ) ,
475
465
) ;
476
466
}
477
467
478
468
function randomLocalTime ( ) {
479
- return new CypherLocalTime (
469
+ return new neo4j . CypherLocalTime (
480
470
randomInt ( 0 , 23 ) ,
481
471
randomInt ( 0 , 59 ) ,
482
472
randomInt ( 0 , 59 ) ,
@@ -485,7 +475,7 @@ describe('temporal-types', () => {
485
475
}
486
476
487
477
function randomZoneOffsetSeconds ( ) {
488
- const randomOffsetWithSeconds = int ( randomInt ( MIN_TIME_ZONE_OFFSET , MAX_TIME_ZONE_OFFSET ) ) ;
478
+ const randomOffsetWithSeconds = neo4j . int ( randomInt ( MIN_TIME_ZONE_OFFSET , MAX_TIME_ZONE_OFFSET ) ) ;
489
479
return randomOffsetWithSeconds . div ( SECONDS_PER_MINUTE ) . multiply ( SECONDS_PER_MINUTE ) ; // truncate seconds
490
480
}
491
481
@@ -494,34 +484,34 @@ describe('temporal-types', () => {
494
484
}
495
485
496
486
function duration ( months , days , seconds , nanoseconds ) {
497
- return new CypherDuration ( int ( months ) , int ( days ) , int ( seconds ) , int ( nanoseconds ) ) ;
487
+ return new neo4j . CypherDuration ( neo4j . int ( months ) , neo4j . int ( days ) , neo4j . int ( seconds ) , neo4j . int ( nanoseconds ) ) ;
498
488
}
499
489
500
490
function localTime ( hour , minute , second , nanosecond ) {
501
- return new CypherLocalTime ( int ( hour ) , int ( minute ) , int ( second ) , int ( nanosecond ) ) ;
491
+ return new neo4j . CypherLocalTime ( neo4j . int ( hour ) , neo4j . int ( minute ) , neo4j . int ( second ) , neo4j . int ( nanosecond ) ) ;
502
492
}
503
493
504
494
function time ( hour , minute , second , nanosecond , offsetSeconds ) {
505
- return new CypherTime ( localTime ( hour , minute , second , nanosecond ) , int ( offsetSeconds ) ) ;
495
+ return new neo4j . CypherTime ( localTime ( hour , minute , second , nanosecond ) , neo4j . int ( offsetSeconds ) ) ;
506
496
}
507
497
508
498
function date ( year , month , day ) {
509
- return new CypherDate ( int ( year ) , int ( month ) , int ( day ) ) ;
499
+ return new neo4j . CypherDate ( neo4j . int ( year ) , neo4j . int ( month ) , neo4j . int ( day ) ) ;
510
500
}
511
501
512
502
function localDateTime ( year , month , day , hour , minute , second , nanosecond ) {
513
- return new CypherLocalDateTime ( date ( year , month , day ) , localTime ( hour , minute , second , nanosecond ) ) ;
503
+ return new neo4j . CypherLocalDateTime ( date ( year , month , day ) , localTime ( hour , minute , second , nanosecond ) ) ;
514
504
}
515
505
516
506
function dateTimeWithZoneOffset ( year , month , day , hour , minute , second , nanosecond , offsetSeconds ) {
517
- return new CypherDateTimeWithZoneOffset ( localDateTime ( year , month , day , hour , minute , second , nanosecond ) , int ( offsetSeconds ) ) ;
507
+ return new neo4j . CypherDateTimeWithZoneOffset ( localDateTime ( year , month , day , hour , minute , second , nanosecond ) , neo4j . int ( offsetSeconds ) ) ;
518
508
}
519
509
520
510
function dateTimeWithZoneId ( year , month , day , hour , minute , second , nanosecond , zoneId ) {
521
- return new CypherDateTimeWithZoneId ( localDateTime ( year , month , day , hour , minute , second , nanosecond ) , zoneId ) ;
511
+ return new neo4j . CypherDateTimeWithZoneId ( localDateTime ( year , month , day , hour , minute , second , nanosecond ) , zoneId ) ;
522
512
}
523
513
524
514
function randomInt ( lower , upper ) {
525
- return int ( _ . random ( lower , upper ) ) ;
515
+ return neo4j . int ( _ . random ( lower , upper ) ) ;
526
516
}
527
517
} ) ;
0 commit comments