mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 07:35:59 +08:00
Fix test and really emit {} on parse failure.
This commit is contained in:
parent
f7e6d53e06
commit
8ca6171a0a
@ -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);
|
||||
|
@ -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.';
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user