Account for imprecision in distance computation

This commit is contained in:
Patrick Niklaus 2016-11-17 19:41:14 +00:00 committed by Patrick Niklaus
parent 24fa94af59
commit f19bf70b55
2 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ Feature: Bike - Surfaces
Then routability should be Then routability should be
| highway | surface | bothw | | highway | surface | bothw |
| cycleway | | 48 s | | cycleway | | 48 s |
| cycleway | asphalt | 48 s | | cycleway | asphalt | 47.9 s|
| cycleway | cobblestone:flattened | 72 s | | cycleway | cobblestone:flattened | 72 s |
| cycleway | paving_stones | 72 s | | cycleway | paving_stones | 72 s |
| cycleway | compacted | 72 s | | cycleway | compacted | 72 s |
@ -26,7 +26,7 @@ Feature: Bike - Surfaces
Then routability should be Then routability should be
| highway | surface | bothw | | highway | surface | bothw |
| cycleway | | 48 s | | cycleway | | 48 s |
| path | | 59.9 s +- 1 | | path | | 59.9 s|
| track | | 60 s | | track | | 60 s |
| track | asphalt | 60 s | | track | asphalt | 60 s |
| path | asphalt | 60 s | | path | asphalt | 60 s |

View File

@ -37,7 +37,7 @@ module.exports = function () {
outputRow[direction] = result[direction].status ? outputRow[direction] = result[direction].status ?
result[direction].status.toString() : ''; result[direction].status.toString() : '';
break; break;
case /^\d+ s/.test(want): case /^[\d\.]+ s/.test(want):
// the result here can come back as a non-number value like // the result here can come back as a non-number value like
// `diff`, but we only want to apply the unit when it comes // `diff`, but we only want to apply the unit when it comes
// back as a number, for tableDiff's literal comparison // back as a number, for tableDiff's literal comparison