mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-14 02:07:54 -06:00
Fixed wipe (includes regression test). #1421
This commit is contained in:
parent
e02ae0d18a
commit
4dd12b57a1
3 changed files with 26 additions and 9 deletions
17
t/gcode.t
17
t/gcode.t
|
@ -1,4 +1,4 @@
|
|||
use Test::More tests => 1;
|
||||
use Test::More tests => 2;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
|
@ -9,6 +9,7 @@ BEGIN {
|
|||
|
||||
use Slic3r;
|
||||
use Slic3r::Geometry qw(scale);
|
||||
use Slic3r::Test;
|
||||
|
||||
{
|
||||
my $gcodegen = Slic3r::GCode->new(
|
||||
|
@ -20,4 +21,18 @@ use Slic3r::Geometry qw(scale);
|
|||
is_deeply $gcodegen->last_pos->arrayref, [scale -10, scale -10], 'last_pos is shifted correctly';
|
||||
}
|
||||
|
||||
{
|
||||
my $config = Slic3r::Config->new_from_defaults;
|
||||
$config->set('wipe', [1]);
|
||||
|
||||
my $print = Slic3r::Test::init_print('20mm_cube', config => $config);
|
||||
my $have_wipe = 0;
|
||||
Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
|
||||
my ($self, $cmd, $args, $info) = @_;
|
||||
$have_wipe = 1 if $info->{retracting} && $info->{dist_XY} > 0;
|
||||
});
|
||||
|
||||
ok $have_wipe, "wipe";
|
||||
}
|
||||
|
||||
__END__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue