From ac6f07a7449d4307bd3cca4c6d9367cf53b17583 Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Tue, 28 Mar 2017 21:26:06 +0200 Subject: [PATCH] make adaptors::tokenized compatible with boost 1.54 --- features/options/partition/invalid.feature | 6 ++++++ src/tools/partition.cpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/features/options/partition/invalid.feature b/features/options/partition/invalid.feature index 195abd609..5a9784660 100644 --- a/features/options/partition/invalid.feature +++ b/features/options/partition/invalid.feature @@ -19,6 +19,12 @@ Feature: osrm-partition command line options: invalid options And stderr should contain "fly-me-to-the-moon" And it should exit with an error + Scenario: osrm-partition - Check invalid values + When I try to run "osrm-partition --max-cell-sizes 4,6@4,16 fly-me-to-the-moon.osrm" + Then stdout should be empty + And stderr should contain "is invalid" + And it should exit with an error + Scenario: osrm-partition - Check non-descending order When I try to run "osrm-partition --max-cell-sizes 4,64,16 fly-me-to-the-moon.osrm" Then stdout should be empty diff --git a/src/tools/partition.cpp b/src/tools/partition.cpp index 488f99d3c..7ea90564d 100644 --- a/src/tools/partition.cpp +++ b/src/tools/partition.cpp @@ -51,7 +51,7 @@ void validate(boost::any &v, const std::vector &values, MaxCellSize const std::string &s = validators::get_single_string(values); std::vector output; - boost::copy(s | tokenized(boost::regex(","), -1) | transformed([](const auto &x) { + boost::copy(s | tokenized(boost::regex("[^,]+")) | transformed([](const auto &x) { try { return boost::lexical_cast(x);