From 660eedfa5b0036a608f3de3ca9c62acb77305cb2 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Wed, 15 Feb 2012 12:04:10 +0100 Subject: [PATCH] Added a couple unit tests --- MANIFEST | 1 + lib/Slic3r/Config.pm | 1 + t/fill.t | 30 ++++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 t/fill.t diff --git a/MANIFEST b/MANIFEST index 11ae47182..3adbb0937 100644 --- a/MANIFEST +++ b/MANIFEST @@ -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 diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index 8ba21b5cd..9bccc9b88 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -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" diff --git a/t/fill.t b/t/fill.t new file mode 100644 index 000000000..f45aab2da --- /dev/null +++ b/t/fill.t @@ -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__