From 6d2f10e7a325d2edc4e630afb01c084b8329fe85 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Wed, 9 Sep 2020 12:25:56 +0200 Subject: [PATCH] More bug fixes --- AspectedRouting/IO/lua/if_then_else_dotted.lua | 3 --- AspectedRouting/IO/lua/parse.lua | 4 ++-- Profiles/bicycle/tests/bicycle.fastest.behaviour_test.csv | 1 + Profiles/general/ferry_speed.test.csv | 1 + 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/AspectedRouting/IO/lua/if_then_else_dotted.lua b/AspectedRouting/IO/lua/if_then_else_dotted.lua index b8aa205..018254e 100644 --- a/AspectedRouting/IO/lua/if_then_else_dotted.lua +++ b/AspectedRouting/IO/lua/if_then_else_dotted.lua @@ -14,9 +14,6 @@ function if_then_else_dotted(conditionf, thnf, elsef, arg) if (condition) then return applyIfNeeded(thnf, arg) else - if(elsef == nil) then - return nil - end return applyIfNeeded(elsef, arg) -- if no third parameter is given, 'els' will be nil end end \ No newline at end of file diff --git a/AspectedRouting/IO/lua/parse.lua b/AspectedRouting/IO/lua/parse.lua index 41a04ad..bd1c475 100644 --- a/AspectedRouting/IO/lua/parse.lua +++ b/AspectedRouting/IO/lua/parse.lua @@ -22,10 +22,10 @@ function parse(string) end end - if(string:match("%d*:%d*")) then + if(string:match("%d+:%d+")) then -- duration in minute local duration = 0 - for part in string:gmatch "%d*" do + for part in string:gmatch "%d+" do duration = duration * 60 + tonumber(part) end return duration diff --git a/Profiles/bicycle/tests/bicycle.fastest.behaviour_test.csv b/Profiles/bicycle/tests/bicycle.fastest.behaviour_test.csv index a96d215..3bed6e1 100644 --- a/Profiles/bicycle/tests/bicycle.fastest.behaviour_test.csv +++ b/Profiles/bicycle/tests/bicycle.fastest.behaviour_test.csv @@ -11,3 +11,4 @@ yes,both,15,15,unclassified,,,track,yes,no,,, yes,both,15,15,service,,,,,,,, yes,both,15,15,tertiary,,,,,,yes,50, yes,with,15,15,residential,,,,,,,,roundabout +dismount,both,2.25,2.25,footway,dismount \ No newline at end of file diff --git a/Profiles/general/ferry_speed.test.csv b/Profiles/general/ferry_speed.test.csv index 6c6155a..a4ecd93 100644 --- a/Profiles/general/ferry_speed.test.csv +++ b/Profiles/general/ferry_speed.test.csv @@ -5,3 +5,4 @@ expected,route,duration,interval,_length,comment null,,,,Ferry is not set 20.442857142857,ferry,00:16,,7155,Waterbus SintAnna-Zwijndrecht - osm.org/way/632117702 9.3326086956522,ferry,00:16,2:00,7155,Non-regular waterbus which goes every two hours. Expected time ppl will wait: 30minutes + 16minutes faring duration = 46minutes for 7km = ~9km/h +24,ferry,0:,0:1,100, \ No newline at end of file