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:
parent
468935c177
commit
bb50dfb9ba
1 changed files with 15 additions and 1 deletions
16
t/gcode.t
16
t/gcode.t
|
@ -1,4 +1,4 @@
|
||||||
use Test::More tests => 6;
|
use Test::More tests => 7;
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
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';
|
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__
|
__END__
|
||||||
|
|
Loading…
Reference in a new issue