Add regression test
This commit is contained in:
parent
c6472eb289
commit
5f5675d361
@ -151,9 +151,16 @@ module.exports = function () {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (headers.has('matchings')) {
|
||||||
|
if (subMatchings.length != row.matchings.split(',').length) {
|
||||||
|
ok = false;
|
||||||
|
cb(new Error('*** table matchings and api response are not the same'));
|
||||||
|
}
|
||||||
|
|
||||||
row.matchings.split(',').forEach((sub, si) => {
|
row.matchings.split(',').forEach((sub, si) => {
|
||||||
q.defer(testSubMatching, sub, si);
|
testSubMatching(sub, si);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
q.awaitAll(() => {
|
q.awaitAll(() => {
|
||||||
if (ok) {
|
if (ok) {
|
||||||
|
@ -180,3 +180,62 @@ Feature: Basic Map Matching
|
|||||||
When I match I should get
|
When I match I should get
|
||||||
| trace | matchings | geometry |
|
| trace | matchings | geometry |
|
||||||
| abd | abd | 1,1,1.000089,1,1.000089,1,1.000089,0.99991 |
|
| abd | abd | 1,1,1.000089,1,1.000089,1,1.000089,0.99991 |
|
||||||
|
|
||||||
|
# Regression test 1 for issue 3176
|
||||||
|
Scenario: Testbot - multiuple segments: properly expose OSM IDs
|
||||||
|
Given the query options
|
||||||
|
| annotations | true |
|
||||||
|
|
||||||
|
Given the node map
|
||||||
|
| a | 1 | b | | c | | d | | e | | f | 2 | g |
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | id |
|
||||||
|
| a | 1 |
|
||||||
|
| b | 2 |
|
||||||
|
| c | 3 |
|
||||||
|
| d | 4 |
|
||||||
|
| e | 5 |
|
||||||
|
| f | 6 |
|
||||||
|
| g | 7 |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | oneway |
|
||||||
|
| ab | no |
|
||||||
|
| bc | no |
|
||||||
|
| cd | no |
|
||||||
|
| de | no |
|
||||||
|
| ef | no |
|
||||||
|
| fg | no |
|
||||||
|
|
||||||
|
When I match I should get
|
||||||
|
| trace | OSM IDs |
|
||||||
|
| 12 | 1,2,3,4,5,6,7 |
|
||||||
|
| 21 | 7,6,5,4,3,2,1 |
|
||||||
|
|
||||||
|
# Regression test 2 for issue 3176
|
||||||
|
Scenario: Testbot - same edge: properly expose OSM IDs
|
||||||
|
Given the query options
|
||||||
|
| annotations | true |
|
||||||
|
|
||||||
|
Given the node map
|
||||||
|
| a | 1 | b | | c | | d | | e | 2 | f |
|
||||||
|
|
||||||
|
And the nodes
|
||||||
|
| node | id |
|
||||||
|
| a | 1 |
|
||||||
|
| b | 2 |
|
||||||
|
| c | 3 |
|
||||||
|
| d | 4 |
|
||||||
|
| e | 5 |
|
||||||
|
| f | 6 |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | oneway |
|
||||||
|
| abcdef | no |
|
||||||
|
|
||||||
|
When I match I should get
|
||||||
|
| trace | OSM IDs |
|
||||||
|
| 12 | 1,2,3,4,5,6 |
|
||||||
|
| 21 | 6,5,4,3,2,1 |
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user