table tests: use empty string to mean no route

This commit is contained in:
Emil Tin 2015-01-03 11:12:27 +01:00
parent 24943ccee6
commit a0b55f9df3
2 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,6 @@
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]==""
@ -36,6 +37,8 @@ When /^I request a travel time matrix I should get$/ do |table|
0.upto(nodes.size-1) do |i|
if FuzzyMatch.match 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
result[ri][i] = result[ri][i].to_s
ok = false

View File

@ -70,7 +70,7 @@ Feature: Basic Distance Matrix
| e | 200 | 100 | 0 | 100 |
| f | 300 | 200 | 100 | 0 |
@todo
@x
Scenario: Testbot - Travel time matrix of network with unroutable parts
Given the node map
| a | b |
@ -82,7 +82,7 @@ Feature: Basic Distance Matrix
When I request a travel time matrix I should get
| | a | b |
| a | 0 | 100 |
| b | -1 | 0 |
| b | | 0 |
Scenario: Testbot - Travel time matrix of network with oneways
Given the node map