Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix test

  • Loading branch information...
commit bfc3616c0c765c506cc74b31034d6de9901d8202 1 parent d219d69
@alexrj authored
Showing with 9 additions and 9 deletions.
  1. +9 −9 t/retraction.t
View
18 t/retraction.t
@@ -16,7 +16,7 @@ my $test = sub {
my ($conf) = @_;
$conf ||= $config;
- my $print = Slic3r::Test::init_print('20mm_cube', config => $config);
+ my $print = Slic3r::Test::init_print('20mm_cube', config => $conf);
my $retracted = 1; # ignore the first travel move from home to first point
my $lifted = 0;
@@ -25,34 +25,34 @@ my $test = sub {
if ($info->{dist_Z}) {
# lift move or lift + change layer
- if (Slic3r::Test::compare($info->{dist_Z}, $config->retract_lift->[0])
- || (Slic3r::Test::compare($info->{dist_Z}, $config->layer_height + $config->retract_lift->[0]) && $config->retract_lift->[0] > 0)) {
- fail 'only lifting while retracted' if !$retracted;
+ if (Slic3r::Test::compare($info->{dist_Z}, $conf->retract_lift->[0])
+ || (Slic3r::Test::compare($info->{dist_Z}, $conf->layer_height + $conf->retract_lift->[0]) && $conf->retract_lift->[0] > 0)) {
+ fail 'only lifting while retracted' if !$retracted && !($conf->g0 && $info->{retracting});
$lifted = 1;
}
if ($info->{dist_Z} < 0) {
fail 'going down only after lifting' if !$lifted;
fail 'going down by the same amount of the lift'
- if !Slic3r::Test::compare($info->{dist_Z}, -$config->retract_lift->[0]);
+ if !Slic3r::Test::compare($info->{dist_Z}, -$conf->retract_lift->[0]);
$lifted = 0;
}
}
if ($info->{retracting}) {
fail 'retracted by the correct amount'
- if !Slic3r::Test::compare(-$info->{dist_E}, $config->retract_length->[0]);
+ if !Slic3r::Test::compare(-$info->{dist_E}, $conf->retract_length->[0]);
fail 'combining retraction and travel with G0'
- if $cmd ne 'G0' && $config->g0 && ($info->{dist_Z} || $info->{dist_XY});
+ if $cmd ne 'G0' && $conf->g0 && ($info->{dist_Z} || $info->{dist_XY});
$retracted = 1;
}
if ($info->{extruding}) {
fail 'only extruding while not lifted' if $lifted;
if ($retracted) {
fail 'unretracted by the correct amount'
- if !Slic3r::Test::compare($info->{dist_E}, $config->retract_length->[0] + $config->retract_restart_extra->[0]);
+ if !Slic3r::Test::compare($info->{dist_E}, $conf->retract_length->[0] + $conf->retract_restart_extra->[0]);
$retracted = 0;
}
}
- if ($info->{travel} && $info->{dist_XY} >= $config->retract_before_travel->[0]) {
+ if ($info->{travel} && $info->{dist_XY} >= $conf->retract_before_travel->[0]) {
fail 'retracted before long travel move' if !$retracted;
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.