table tests: use empty string to mean no route
This commit is contained in:
parent
24943ccee6
commit
a0b55f9df3
@ -1,5 +1,6 @@
|
|||||||
When /^I request a travel time matrix I should get$/ do |table|
|
When /^I request a travel time matrix I should get$/ do |table|
|
||||||
|
|
||||||
|
no_route = 2147483647 # MAX_INT
|
||||||
|
|
||||||
raise "*** Top-left cell of matrix table must be empty" unless table.headers[0]==""
|
raise "*** Top-left cell of matrix table must be empty" unless table.headers[0]==""
|
||||||
|
|
||||||
@ -36,6 +37,8 @@ When /^I request a travel time matrix I should get$/ do |table|
|
|||||||
0.upto(nodes.size-1) do |i|
|
0.upto(nodes.size-1) do |i|
|
||||||
if FuzzyMatch.match result[ri][i], row[i+1]
|
if FuzzyMatch.match result[ri][i], row[i+1]
|
||||||
result[ri][i] = row[i+1]
|
result[ri][i] = row[i+1]
|
||||||
|
elsif row[i+1]=="" and result[ri][i]==no_route
|
||||||
|
result[ri][i] = ""
|
||||||
else
|
else
|
||||||
result[ri][i] = result[ri][i].to_s
|
result[ri][i] = result[ri][i].to_s
|
||||||
ok = false
|
ok = false
|
||||||
|
@ -70,7 +70,7 @@ Feature: Basic Distance Matrix
|
|||||||
| e | 200 | 100 | 0 | 100 |
|
| e | 200 | 100 | 0 | 100 |
|
||||||
| f | 300 | 200 | 100 | 0 |
|
| f | 300 | 200 | 100 | 0 |
|
||||||
|
|
||||||
@todo
|
@x
|
||||||
Scenario: Testbot - Travel time matrix of network with unroutable parts
|
Scenario: Testbot - Travel time matrix of network with unroutable parts
|
||||||
Given the node map
|
Given the node map
|
||||||
| a | b |
|
| a | b |
|
||||||
@ -82,7 +82,7 @@ Feature: Basic Distance Matrix
|
|||||||
When I request a travel time matrix I should get
|
When I request a travel time matrix I should get
|
||||||
| | a | b |
|
| | a | b |
|
||||||
| a | 0 | 100 |
|
| a | 0 | 100 |
|
||||||
| b | -1 | 0 |
|
| b | | 0 |
|
||||||
|
|
||||||
Scenario: Testbot - Travel time matrix of network with oneways
|
Scenario: Testbot - Travel time matrix of network with oneways
|
||||||
Given the node map
|
Given the node map
|
||||||
|
Loading…
Reference in New Issue
Block a user