2013-09-06 17:14:06 +00:00
|
|
|
use Test::More tests => 2;
|
2013-01-27 12:06:45 +00:00
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
|
|
|
BEGIN {
|
|
|
|
use FindBin;
|
|
|
|
use lib "$FindBin::Bin/../lib";
|
|
|
|
}
|
|
|
|
|
|
|
|
use Slic3r;
|
|
|
|
use Slic3r::Geometry qw(scale);
|
2013-09-06 17:14:06 +00:00
|
|
|
use Slic3r::Test;
|
2013-01-27 12:06:45 +00:00
|
|
|
|
|
|
|
{
|
2013-05-31 09:19:36 +00:00
|
|
|
my $gcodegen = Slic3r::GCode->new(
|
|
|
|
config => Slic3r::Config->new_from_defaults,
|
|
|
|
layer_count => 1,
|
2013-09-03 17:26:58 +00:00
|
|
|
extruders => [],
|
2013-05-31 09:19:36 +00:00
|
|
|
);
|
2013-01-27 12:06:45 +00:00
|
|
|
$gcodegen->set_shift(10, 10);
|
2013-07-15 18:31:43 +00:00
|
|
|
is_deeply $gcodegen->last_pos->arrayref, [scale -10, scale -10], 'last_pos is shifted correctly';
|
2013-01-27 12:06:45 +00:00
|
|
|
}
|
|
|
|
|
2013-09-06 17:14:06 +00:00
|
|
|
{
|
|
|
|
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";
|
|
|
|
}
|
|
|
|
|
2013-01-27 12:06:45 +00:00
|
|
|
__END__
|