add tests for the gaps and tidy map matching flags #4145
This commit is contained in:
		
							parent
							
								
									5ee3c4de9f
								
							
						
					
					
						commit
						9d30817294
					
				@ -133,7 +133,9 @@ test('match: match in Monaco with all options', function(assert) {
 | 
				
			|||||||
        steps: true,
 | 
					        steps: true,
 | 
				
			||||||
        annotations: true,
 | 
					        annotations: true,
 | 
				
			||||||
        overview: 'false',
 | 
					        overview: 'false',
 | 
				
			||||||
        geometries: 'geojson'
 | 
					        geometries: 'geojson',
 | 
				
			||||||
 | 
					        gaps: 'split',
 | 
				
			||||||
 | 
					        tidy: false
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
    osrm.match(options, function(err, response) {
 | 
					    osrm.match(options, function(err, response) {
 | 
				
			||||||
        assert.ifError(err);
 | 
					        assert.ifError(err);
 | 
				
			||||||
@ -196,3 +198,28 @@ test('match: throws on invalid timestamps param', function(assert) {
 | 
				
			|||||||
    assert.throws(function() { osrm.match(options, function(err, response) {}) },
 | 
					    assert.throws(function() { osrm.match(options, function(err, response) {}) },
 | 
				
			||||||
        /Timestamp array must have the same size as the coordinates array/);
 | 
					        /Timestamp array must have the same size as the coordinates array/);
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test('match: throws on invalid gaps param', function(assert) {
 | 
				
			||||||
 | 
					    assert.plan(2);
 | 
				
			||||||
 | 
					    var osrm = new OSRM(data_path);
 | 
				
			||||||
 | 
					    var options = {
 | 
				
			||||||
 | 
					        coordinates: three_test_coordinates,
 | 
				
			||||||
 | 
					        gaps: ['invalid gaps param']
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    assert.throws(function() { osrm.match(options, function(err, response) {}) },
 | 
				
			||||||
 | 
					        /Gaps must be a string: \[split, ignore\]/);
 | 
				
			||||||
 | 
					    options.gaps = 'invalid gaps param';
 | 
				
			||||||
 | 
					    assert.throws(function() { osrm.match(options, function(err, response) {}) },
 | 
				
			||||||
 | 
					        /'gaps' param must be one of \[split, ignore\]/);
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test('match: throws on invalid tidy param', function(assert) {
 | 
				
			||||||
 | 
					    assert.plan(1);
 | 
				
			||||||
 | 
					    var osrm = new OSRM(data_path);
 | 
				
			||||||
 | 
					    var options = {
 | 
				
			||||||
 | 
					        coordinates: three_test_coordinates,
 | 
				
			||||||
 | 
					        tidy: 'invalid tidy param'
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    assert.throws(function() { osrm.match(options, function(err, response) {}) },
 | 
				
			||||||
 | 
					        /tidy must be of type Boolean/);
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user