Added a couple unit tests

This commit is contained in:
Alessandro Ranellucci 2012-02-15 12:04:10 +01:00
parent 68f001a7de
commit 660eedfa5b
3 changed files with 32 additions and 0 deletions

View File

@ -45,6 +45,7 @@ t/arcs.t
t/clean_polylines.t
t/clipper.t
t/collinear.t
t/fill.t
t/geometry.t
t/polyclip.t
t/stl.t

View File

@ -449,6 +449,7 @@ sub validate {
Slic3r::debugf "Flow width = $Slic3r::flow_width\n";
Slic3r::debugf "Flow spacing = $Slic3r::flow_spacing\n";
Slic3r::debugf "Min flow spacing = $Slic3r::min_flow_spacing\n";
# --perimeters
die "Invalid value for --perimeters\n"

30
t/fill.t Normal file
View File

@ -0,0 +1,30 @@
use Test::More;
use strict;
use warnings;
plan tests => 2;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
}
use Slic3r;
my $print = Slic3r::Print->new(
x_length => 50,
y_length => 50,
);
{
my $filler = Slic3r::Fill::Rectilinear->new(print => $print);
my $surface_width = 250;
my $distance = $filler->adjust_solid_spacing(
width => $surface_width,
distance => 100,
);
is $distance, 125, 'adjusted solid distance';
is $surface_width % $distance, 0, 'adjusted solid distance';
}
__END__