pass flags into process_segment (#6658)

* pass flags into process_segment

---------

Co-authored-by: Michael Bell <michael@mjjbell.com>
This commit is contained in:
Matthew Wigginton Bhagat-Conway
2024-04-06 04:27:42 -04:00
committed by GitHub
parent 8ef366e061
commit 7ebd21f39e
5 changed files with 69 additions and 4 deletions
+24
View File
@@ -154,3 +154,27 @@ Feature: osrm-extract lua ways:get_nodes()
Then it should exit successfully
And stdout should contain "node 42"
And stdout should contain "way 42"
Scenario: osrm-extract flags accessible in process_segment function
Given the profile file
"""
functions = require('testbot')
functions.process_segment = function (profile, segment)
print('segment forward ' .. tostring(segment.flags.forward) .. ' backward ' .. tostring(segment.flags.backward))
end
return functions
"""
And the node map
"""
a b
"""
And the ways
| nodes | oneway |
| ab | yes |
And the data has been saved to disk
When I run "osrm-extract --profile {profile_file} {osm_file}"
Then it should exit successfully
And stdout should contain "segment forward true backward false"