CAD-Mesh3D
view release on metacpan or search on metacpan
t/STL-outputStl.t view on Meta::CPAN
676869707172737475767778798081828384858687# compare the expected values for the ascii tests
sub
test_ascii {
my
(
$ascii_string
,
$expect_aref
,
$test_name
) =
@_
;
$test_name
=
"test_ascii::${test_name}"
;
note
"\n"
,
$test_name
;
$ascii_string
=~ s/\h+/ /gm;
# normalize horizontal whitespace
$ascii_string
=~ s/^\s+//gm;
# trim leading whitespace on any line
$ascii_string
=~ s/\s+$//gm;
# trim trailing whitespace on any line
#note "-----\n", $ascii_string, "\n=====\n";
$ascii_string
=~ m/^solid *(?<name>\V*?)$(?<content>.*)^endsolid *\g{name}*$/ms;
my
$name
= $+{name};
#note "\t", name => "\t", $name;
my
$content
= $+{content};
#note "\t", content => "\t", $content;
ok
$content
,
"${test_name}: solid/endsolid has content"
;
my
@facets
=
$content
=~ m/^facet *(.*?)\R+^endfacet$/gms;
my
$n
=
scalar
@facets
;
is
$n
, 4,
"${test_name}: has 4 facets"
;
my
@vectors
;
foreach
my
$facet
(
@facets
) {
( run in 0.651 second using v1.01-cache-2.11-cpan-d6f9594c0a5 )