Test that absolute_E is positive at the end of print (and document that it accounts for the final retraction)

This commit is contained in:
Alessandro Ranellucci 2014-01-11 14:24:40 +01:00
parent 468935c177
commit bb50dfb9ba

View file

@ -1,4 +1,4 @@
use Test::More tests => 6;
use Test::More tests => 7;
use strict;
use warnings;
@ -69,4 +69,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__