#!/usr/bin/perl use strict; use warnings; use lib 't/lib'; use ExtUtils::MakeMaker; use File::Temp qw[tempfile]; use Test::More 'no_plan'; sub test_abstract { my($code, $package, $want, $name) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; my $ok = 0; for my $crlf (0, 1) { my ($fh,$file) = tempfile( DIR => 't', UNLINK => 1 ); binmode $fh, $crlf ? ':crlf' : ':raw'; print $fh $code; close $fh; # Hack up a minimal MakeMaker object. my $mm = bless { DISTNAME => $package }, "MM"; my $have = $mm->parse_abstract($file); $ok += is( $have, $want, "$name :crlf=$crlf" ) ? 1 : 0; } return $ok; } test_abstract(<