Commit 4e5c4521 authored by Tijana Vukovic's avatar Tijana Vukovic Committed by Artur Wojcik
Browse files

Fixed test_stringutils

parent 8ebb0a24
...@@ -149,6 +149,10 @@ interpolate_string(const std::string& input, F f, std::string start = "${", std: ...@@ -149,6 +149,10 @@ interpolate_string(const std::string& input, F f, std::string start = "${", std:
result.append(it, next_start); result.append(it, next_start);
if(next_start == input.end()) if(next_start == input.end())
break; break;
if(next_end == input.end())
{
throw std::runtime_error("Unbalanced brackets");
}
auto r = f(next_start + start.size(), next_end); auto r = f(next_start + start.size(), next_end);
result.append(r.begin(), r.end()); result.append(r.begin(), r.end());
it = next_end + end.size(); it = next_end + end.size();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment