@@ -424,6 +424,7 @@ test('route: integer bearing values no longer supported', function(assert) {
424
424
var options = {
425
425
coordinates : two_test_coordinates ,
426
426
bearings : [ 200 , 250 ] ,
427
+ radiuses : [ null ] ,
427
428
} ;
428
429
assert . throws ( function ( ) { osrm . route ( options , function ( err , route ) { } ) ; } ,
429
430
/ B e a r i n g m u s t b e a n a r r a y o f \[ b e a r i n g , r a n g e \] o r n u l l / ) ;
@@ -435,6 +436,7 @@ test('route: valid bearing values', function(assert) {
435
436
var options = {
436
437
coordinates : two_test_coordinates ,
437
438
bearings : [ [ 200 , 180 ] , [ 250 , 180 ] ] ,
439
+ radiuses : [ null , null ] ,
438
440
} ;
439
441
osrm . route ( options , function ( err , route ) {
440
442
assert . ifError ( err ) ;
@@ -448,38 +450,49 @@ test('route: valid bearing values', function(assert) {
448
450
} ) ;
449
451
450
452
test ( 'route: invalid bearing values' , function ( assert ) {
451
- assert . plan ( 6 ) ;
453
+ assert . plan ( 7 ) ;
452
454
var osrm = new OSRM ( monaco_path ) ;
453
455
assert . throws ( function ( ) { osrm . route ( {
454
456
coordinates : two_test_coordinates ,
455
457
bearings : [ [ 400 , 180 ] , [ - 250 , 180 ] ] ,
458
+ radiuses : [ null , null ] ,
456
459
} , function ( err , route ) { } ) } ,
457
460
/ B e a r i n g v a l u e s n e e d t o b e i n r a n g e 0 ..3 6 0 , 0 ..1 8 0 / ) ;
458
461
assert . throws ( function ( ) { osrm . route ( {
459
462
coordinates : two_test_coordinates ,
460
463
bearings : [ [ 200 ] , [ 250 , 180 ] ] ,
464
+ radiuses : [ null , null ] ,
461
465
} , function ( err , route ) { } ) } ,
462
466
/ B e a r i n g m u s t b e a n a r r a y o f / ) ;
463
467
assert . throws ( function ( ) { osrm . route ( {
464
468
coordinates : two_test_coordinates ,
465
469
bearings : [ [ 400 , 109 ] , [ 100 , 720 ] ] ,
470
+ radiuses : [ null , null ] ,
466
471
} , function ( err , route ) { } ) } ,
467
472
/ B e a r i n g v a l u e s n e e d t o b e i n r a n g e 0 ..3 6 0 , 0 ..1 8 0 / ) ;
468
473
assert . throws ( function ( ) { osrm . route ( {
469
474
coordinates : two_test_coordinates ,
470
475
bearings : 400 ,
476
+ radiuses : [ null ] ,
471
477
} , function ( err , route ) { } ) } ,
472
478
/ B e a r i n g s m u s t b e a n a r r a y o f a r r a y s o f n u m b e r s / ) ;
473
479
assert . throws ( function ( ) { osrm . route ( {
474
480
coordinates : two_test_coordinates ,
475
481
bearings : [ [ 100 , 100 ] ] ,
482
+ radiuses : [ null , null ] ,
476
483
} , function ( err , route ) { } ) } ,
477
484
/ B e a r i n g s a r r a y m u s t h a v e t h e s a m e l e n g t h a s c o o r d i n a t e s a r r a y / ) ;
478
485
assert . throws ( function ( ) { osrm . route ( {
479
486
coordinates : two_test_coordinates ,
480
487
bearings : [ Infinity , Infinity ] ,
488
+ radiuses : [ null , null ] ,
481
489
} , function ( err , route ) { } ) } ,
482
490
/ B e a r i n g m u s t b e a n a r r a y o f \[ b e a r i n g , r a n g e \] o r n u l l / ) ;
491
+ assert . throws ( function ( ) { osrm . route ( {
492
+ coordinates : two_test_coordinates ,
493
+ bearings : [ [ 0 , 180 ] , [ 0 , 180 ] ] ,
494
+ } , function ( err , route ) { } ) } ,
495
+ / B e a r i n g s m u s t b e a c c o m p a n i e d w i t h r a d i u s e s / ) ;
483
496
} ) ;
484
497
485
498
test ( 'route: routes Monaco with hints' , function ( assert ) {
0 commit comments