Acme-Pi

 view release on metacpan or  search on metacpan

t/02-import.t  view on Meta::CPAN

use strict;
use warnings;

use open ':std', ':encoding(UTF-8)'; # force stdin, stdout, stderr into utf8
use Test::More 0.88;
use utf8;
use Acme::Pi;

ok(defined($Ï€), 'we have a defined $Ï€');
ok(defined($𝝿), 'we have a defined $𝝿');
ok(defined(π), 'we have a defined π sub');
ok(defined(𝝿), 'we have a defined 𝝿 sub');

ok((3.14 < $Ï€) && ($Ï€ < 3.15), '$Ï€ is between 3.14 and 3.15');

t/04-bignum.t  view on Meta::CPAN

use strict;
use warnings;

use open ':std', ':encoding(UTF-8)'; # force stdin, stdout, stderr into utf8
use Test::More 0.88;
use utf8;
use Acme::Pi;

my $original_length = length(atan2(1,1) * 4);

my $length = length(Ï€);
ok($length > 20, 'Ï€ has many digits of precision ('.$length.')');
ok($length > $original_length, '...which is more digits than the previous version of π ('.$original_length.')');

xt/author/00-compile.t  view on Meta::CPAN

use File::Spec;
use IPC::Open3;
use IO::Handle;

open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!";

my @warnings;
for my $lib (@module_files)
{
    # see L<perlfaq8/How can I capture STDERR from an external command?>
    my $stderr = IO::Handle->new;

    diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} }
            $^X, @switches, '-e', "require q[$lib]"))
        if $ENV{PERL_COMPILE_TEST_DEBUG};

    my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]");
    binmode $stderr, ':crlf' if $^O eq 'MSWin32';
    my @_warnings = <$stderr>;
    waitpid($pid, 0);
    is($?, 0, "$lib loaded ok");

    shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/
        and not eval { +require blib; blib->VERSION('1.01') };

    if (@_warnings)
    {
        warn @_warnings;
        push @warnings, @_warnings;



( run in 0.860 second using v1.01-cache-2.11-cpan-49f99fa48dc )