From 529d1b19c38f6c79736a28403a451e755754a041 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 11 Jan 2014 14:24:40 +0100 Subject: [PATCH] Test that absolute_E is positive at the end of print (and document that it accounts for the final retraction) --- t/gcode.t | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/t/gcode.t b/t/gcode.t index bd5677fc7..895277f35 100644 --- a/t/gcode.t +++ b/t/gcode.t @@ -1,4 +1,4 @@ -use Test::More tests => 6; +use Test::More tests => 7; use strict; use warnings; @@ -68,4 +68,18 @@ use Slic3r::Test; is_deeply [ @z_moves[0..($layer_count-1)] ], [ @z_moves[$layer_count..$#z_moves] ], 'complete_objects generates the correct Z moves'; } +{ + my $config = Slic3r::Config->new_from_defaults; + $config->set('retract_length', [1000000]); + $config->set('use_relative_e_distances', 1); + my $print = Slic3r::Test::init_print('20mm_cube', config => $config); + Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub { + my ($self, $cmd, $args, $info) = @_; + + + }); + # account for one single retraction at the end of the print + ok $print->extruders->[0]->absolute_E + $config->retract_length->[0] > 0, 'total filament length is positive'; +} + __END__