github actions: Fix TestExprEngine

This commit is contained in:
Daniel Marjamäki 2020-05-13 09:50:25 +02:00
parent e2aec95fc9
commit 0c97625aa0
1 changed files with 8 additions and 0 deletions

View File

@ -99,6 +99,12 @@ private:
#endif #endif
} }
static void replace(std::string& str, const std::string& from, const std::string& to) {
size_t pos = 0;
while ((pos = str.find(from, pos)) != std::string::npos)
str.replace(pos, from.length(), to);
}
static std::string cleanupExpr(std::string rawexpr) { static std::string cleanupExpr(std::string rawexpr) {
std::string ret; std::string ret;
std::istringstream istr(rawexpr); std::istringstream istr(rawexpr);
@ -115,6 +121,8 @@ private:
line.erase(0,8); line.erase(0,8);
line.erase(line.size()-1); line.erase(line.size()-1);
} }
replace(line, "(fp.gt ", "(>");
replace(line, "(fp.lt ", "(<");
int par = 0; int par = 0;
for (int pos = 0; pos < line.size(); ++pos) { for (int pos = 0; pos < line.size(); ++pos) {
if (line[pos] == '(') if (line[pos] == '(')