mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 11:23:42 +00:00
Avoid test failures due to floating point values comparison
This commit is contained in:
6
t/arcs.t
6
t/arcs.t
@@ -10,6 +10,7 @@ BEGIN {
|
|||||||
}
|
}
|
||||||
|
|
||||||
use Slic3r;
|
use Slic3r;
|
||||||
|
use Slic3r::Geometry qw(epsilon);
|
||||||
|
|
||||||
{
|
{
|
||||||
my $path = Slic3r::ExtrusionPath->cast([
|
my $path = Slic3r::ExtrusionPath->cast([
|
||||||
@@ -51,8 +52,9 @@ use Slic3r;
|
|||||||
isa_ok $collection1->paths->[0], 'Slic3r::ExtrusionPath::Arc', 'path';
|
isa_ok $collection1->paths->[0], 'Slic3r::ExtrusionPath::Arc', 'path';
|
||||||
isa_ok $collection2->paths->[0], 'Slic3r::ExtrusionPath::Arc', 'path';
|
isa_ok $collection2->paths->[0], 'Slic3r::ExtrusionPath::Arc', 'path';
|
||||||
|
|
||||||
is $collection1->paths->[0]->length, 7.06858347057701, 'cw oriented arc has correct length';
|
my $expected_length = 7.06858347057701;
|
||||||
is $collection2->paths->[0]->length, 7.06858347057705, 'ccw oriented arc has correct length';
|
ok abs($collection1->paths->[0]->length - $expected_length) < epsilon, 'cw oriented arc has correct length';
|
||||||
|
ok abs($collection2->paths->[0]->length - $expected_length) < epsilon, 'ccw oriented arc has correct length';
|
||||||
|
|
||||||
is $collection1->paths->[0]->orientation, 'cw', 'cw orientation was correctly detected';
|
is $collection1->paths->[0]->orientation, 'cw', 'cw orientation was correctly detected';
|
||||||
is $collection2->paths->[0]->orientation, 'ccw', 'ccw orientation was correctly detected';
|
is $collection2->paths->[0]->orientation, 'ccw', 'ccw orientation was correctly detected';
|
||||||
|
|||||||
Reference in New Issue
Block a user