Fix test and really emit {} on parse failure.

This commit is contained in:
Joseph Lenox 2017-11-06 22:03:27 -06:00
parent f7e6d53e06
commit 8ca6171a0a
2 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ std::string evaluate(const std::string& expression_string) {
#if SLIC3R_DEBUG
std::cerr << __FILE__ << ":" << __LINE__ << " "<< "Failed to parse: " << expression_string.c_str() << std::endl;
#endif
result << "" << expression_string << "";
result << "\x80" << expression_string << "\x81";
}
std::string output = result.str();
trim(output);

View File

@ -47,6 +47,6 @@ use Test::More tests => 7;
my $test_string = "M104 S{a}; Sets temp to {4*5}";
my $result = Slic3r::ConditionalGCode::apply_math($test_string);
is $result, "M104 Sa; Sets temp to 20", 'string (minus brackets) on failure to parse.';
is $result, "M104 S{a}; Sets temp to 20", 'string (minus brackets) on failure to parse.';
}
}