diff options
author | Matthias Urlichs <matthias@urlichs.de> | 2019-12-04 11:31:21 +0300 |
---|---|---|
committer | Matthias Urlichs <matthias@urlichs.de> | 2019-12-04 11:32:22 +0300 |
commit | 329ad97a842ce6f1436fd202c854c6b41f8d6422 (patch) | |
tree | 2037cc242508e155114191d16cb8fd27eef80a2b /t | |
parent | a00ff7b06fb664ccde7496b0920bb4a6978a4a0c (diff) |
Add int() and % (modulo)
Diffstat (limited to 't')
-rw-r--r-- | t/custom_gcode.t | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/t/custom_gcode.t b/t/custom_gcode.t index 4c1c1b108..5ffd9b7f4 100644 --- a/t/custom_gcode.t +++ b/t/custom_gcode.t @@ -67,6 +67,8 @@ use Slic3r::Test; is $parser->process('{2*3/6}'), '1', 'math: 2*3/6'; is $parser->process('{2*3/12}'), '0', 'math: 2*3/12'; ok abs($parser->process('{2.*3/12}') - 0.5) < 1e-7, 'math: 2.*3/12'; + is $parser->process('{10%2.5}') '0', 'math: 10 % 2.5'; + is $parser->process('{11/2.5-1}') '1', 'math: 11 % 2.5'; is $parser->process('{2*(3-12)}'), '-18', 'math: 2*(3-12)'; is $parser->process('{2*foo*(3-12)}'), '0', 'math: 2*foo*(3-12)'; is $parser->process('{2*bar*(3-12)}'), '-36', 'math: 2*bar*(3-12)'; @@ -75,6 +77,7 @@ use Slic3r::Test; is $parser->process('{max(12, 14)}'), '14', 'math: max(12, 14)'; is $parser->process('{min(13.4, -1238.1)}'), '-1238.1', 'math: min(13.4, -1238.1)'; is $parser->process('{max(13.4, -1238.1)}'), '13.4', 'math: max(13.4, -1238.1)'; + is $parser->process('{int(13.4)}'), '13', 'math: int(13.4)'; # Test the boolean expression parser. is $parser->evaluate_boolean_expression('12 == 12'), 1, 'boolean expression parser: 12 == 12'; |