aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Custodio <pauloscustodio@gmail.com>2021-06-20 01:41:24 +0100
committerPaulo Custodio <pauloscustodio@gmail.com>2021-06-20 01:41:24 +0100
commit312b048962f94d027705faf70894fd36e21f4db6 (patch)
tree3cf8ece8ae6e59af721b4b36fb4a045a5b03f7cb
parent0ed815ce97a445c5a43d6eb496b29970d1d89bc7 (diff)
downloadperlweeklychallenge-club-312b048962f94d027705faf70894fd36e21f4db6.tar.gz
perlweeklychallenge-club-312b048962f94d027705faf70894fd36e21f4db6.tar.bz2
perlweeklychallenge-club-312b048962f94d027705faf70894fd36e21f4db6.zip
Normalize test scripts
-rw-r--r--challenge-001/paulo-custodio/test.pl4
-rw-r--r--challenge-002/paulo-custodio/test.pl8
-rw-r--r--challenge-003/paulo-custodio/test.pl8
-rwxr-xr-xchallenge-004/paulo-custodio/test.pl2
-rw-r--r--challenge-005/paulo-custodio/test.pl8
-rw-r--r--challenge-006/paulo-custodio/perl/ch-2.pl2
-rw-r--r--challenge-006/paulo-custodio/test.pl21
-rw-r--r--challenge-090/paulo-custodio/test.pl9
-rw-r--r--challenge-091/paulo-custodio/test.pl9
-rw-r--r--challenge-092/paulo-custodio/test.pl9
-rw-r--r--challenge-093/paulo-custodio/test.pl9
-rw-r--r--challenge-096/paulo-custodio/test.pl9
-rw-r--r--challenge-097/paulo-custodio/test.pl9
-rwxr-xr-xchallenge-098/paulo-custodio/test.pl9
-rw-r--r--challenge-099/paulo-custodio/test.pl9
-rw-r--r--challenge-100/paulo-custodio/test.pl9
-rw-r--r--challenge-101/paulo-custodio/test.pl9
-rw-r--r--challenge-102/paulo-custodio/test.pl9
-rw-r--r--challenge-103/paulo-custodio/test.pl9
-rw-r--r--challenge-104/paulo-custodio/test.pl9
-rw-r--r--challenge-105/paulo-custodio/test.pl9
-rw-r--r--challenge-106/paulo-custodio/test.pl9
-rwxr-xr-xchallenge-107/paulo-custodio/test.pl7
-rwxr-xr-xchallenge-108/paulo-custodio/test.pl7
-rwxr-xr-xchallenge-109/paulo-custodio/test.pl7
-rwxr-xr-xchallenge-110/paulo-custodio/test.pl7
-rwxr-xr-xchallenge-111/paulo-custodio/test.pl7
-rwxr-xr-xchallenge-112/paulo-custodio/test.pl7
-rwxr-xr-xchallenge-113/paulo-custodio/test.pl7
-rwxr-xr-xchallenge-114/paulo-custodio/test.pl7
-rwxr-xr-xchallenge-115/paulo-custodio/test.pl7
-rwxr-xr-xchallenge-116/paulo-custodio/test.pl7
-rwxr-xr-xchallenge-117/paulo-custodio/test.pl7
33 files changed, 79 insertions, 186 deletions
diff --git a/challenge-001/paulo-custodio/test.pl b/challenge-001/paulo-custodio/test.pl
index bc1f0a9a13..a8a46745f3 100644
--- a/challenge-001/paulo-custodio/test.pl
+++ b/challenge-001/paulo-custodio/test.pl
@@ -141,11 +141,11 @@ sub build {
return "bc -lq $prog";
}
if (/^c$/) {
- run("gcc $prog -o $prog_wo_ext") if (!-f $exe || -M $exe > -M $prog);
+ run("gcc $prog -o $prog_wo_ext -lmpfr -lgmp") if (!-f $exe || -M $exe > -M $prog);
return $exe;
}
if (/^cpp$/) {
- run("g++ $prog -o $prog_wo_ext") if (!-f $exe || -M $exe > -M $prog);
+ run("g++ $prog -o $prog_wo_ext -lmpfr -lgmpxx -lgmp") if (!-f $exe || -M $exe > -M $prog);
return $exe;
}
if (/^d$/) {
diff --git a/challenge-002/paulo-custodio/test.pl b/challenge-002/paulo-custodio/test.pl
index a61c28ebb7..ba6c37260b 100644
--- a/challenge-002/paulo-custodio/test.pl
+++ b/challenge-002/paulo-custodio/test.pl
@@ -1,8 +1,4 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
+#!/usr/bin/env perl
+use Modern::Perl;
use Test::More;
-use 5.030;
-
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-003/paulo-custodio/test.pl b/challenge-003/paulo-custodio/test.pl
index a61c28ebb7..ba6c37260b 100644
--- a/challenge-003/paulo-custodio/test.pl
+++ b/challenge-003/paulo-custodio/test.pl
@@ -1,8 +1,4 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
+#!/usr/bin/env perl
+use Modern::Perl;
use Test::More;
-use 5.030;
-
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-004/paulo-custodio/test.pl b/challenge-004/paulo-custodio/test.pl
index 921572d853..ba6c37260b 100755
--- a/challenge-004/paulo-custodio/test.pl
+++ b/challenge-004/paulo-custodio/test.pl
@@ -1,6 +1,4 @@
#!/usr/bin/env perl
-
use Modern::Perl;
use Test::More;
-
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-005/paulo-custodio/test.pl b/challenge-005/paulo-custodio/test.pl
index a61c28ebb7..ba6c37260b 100644
--- a/challenge-005/paulo-custodio/test.pl
+++ b/challenge-005/paulo-custodio/test.pl
@@ -1,8 +1,4 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
+#!/usr/bin/env perl
+use Modern::Perl;
use Test::More;
-use 5.030;
-
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-006/paulo-custodio/perl/ch-2.pl b/challenge-006/paulo-custodio/perl/ch-2.pl
index ac82ef2dae..27e2a01372 100644
--- a/challenge-006/paulo-custodio/perl/ch-2.pl
+++ b/challenge-006/paulo-custodio/perl/ch-2.pl
@@ -3,7 +3,7 @@
# Challenge 006
#
# Challenge #2
-# Create a script to calculate Ramanujan’s constant with at least 32 digits of
+# Create a script to calculate Ramanujan's constant with at least 32 digits of
# precision. Find out more about it here.
#
# The standard IEEE 754 double-precision binary floating-point format: binary64
diff --git a/challenge-006/paulo-custodio/test.pl b/challenge-006/paulo-custodio/test.pl
index 9cb60254fd..ba6c37260b 100644
--- a/challenge-006/paulo-custodio/test.pl
+++ b/challenge-006/paulo-custodio/test.pl
@@ -1,19 +1,4 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
+#!/usr/bin/env perl
+use Modern::Perl;
use Test::More;
-use 5.030;
-
-is capture("perl perl/ch-1.pl 1,2,3,4,9,10,14,15,16"), "1-4,9,10,14-16\n";
-
-is capture("perl perl/ch-2.pl"), "262537412640768743.9999999999992500725971981856888793538563373316\n";
-
-done_testing;
-
-sub capture {
- my($cmd) = @_;
- my $out = `$cmd`;
- $out =~ s/[ \t\v\f\r]*\n/\n/g;
- return $out;
-}
+require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-090/paulo-custodio/test.pl b/challenge-090/paulo-custodio/test.pl
index 01ed2b83cd..ba6c37260b 100644
--- a/challenge-090/paulo-custodio/test.pl
+++ b/challenge-090/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use 5.030;
-
+#!/usr/bin/env perl
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-091/paulo-custodio/test.pl b/challenge-091/paulo-custodio/test.pl
index 01ed2b83cd..ba6c37260b 100644
--- a/challenge-091/paulo-custodio/test.pl
+++ b/challenge-091/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use 5.030;
-
+#!/usr/bin/env perl
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-092/paulo-custodio/test.pl b/challenge-092/paulo-custodio/test.pl
index 01ed2b83cd..ba6c37260b 100644
--- a/challenge-092/paulo-custodio/test.pl
+++ b/challenge-092/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use 5.030;
-
+#!/usr/bin/env perl
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-093/paulo-custodio/test.pl b/challenge-093/paulo-custodio/test.pl
index 01ed2b83cd..ba6c37260b 100644
--- a/challenge-093/paulo-custodio/test.pl
+++ b/challenge-093/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use 5.030;
-
+#!/usr/bin/env perl
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-096/paulo-custodio/test.pl b/challenge-096/paulo-custodio/test.pl
index 01ed2b83cd..ba6c37260b 100644
--- a/challenge-096/paulo-custodio/test.pl
+++ b/challenge-096/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use 5.030;
-
+#!/usr/bin/env perl
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-097/paulo-custodio/test.pl b/challenge-097/paulo-custodio/test.pl
index 01ed2b83cd..ba6c37260b 100644
--- a/challenge-097/paulo-custodio/test.pl
+++ b/challenge-097/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use 5.030;
-
+#!/usr/bin/env perl
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-098/paulo-custodio/test.pl b/challenge-098/paulo-custodio/test.pl
index 01ed2b83cd..ba6c37260b 100755
--- a/challenge-098/paulo-custodio/test.pl
+++ b/challenge-098/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use 5.030;
-
+#!/usr/bin/env perl
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-099/paulo-custodio/test.pl b/challenge-099/paulo-custodio/test.pl
index 01ed2b83cd..ba6c37260b 100644
--- a/challenge-099/paulo-custodio/test.pl
+++ b/challenge-099/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use 5.030;
-
+#!/usr/bin/env perl
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-100/paulo-custodio/test.pl b/challenge-100/paulo-custodio/test.pl
index 01ed2b83cd..ba6c37260b 100644
--- a/challenge-100/paulo-custodio/test.pl
+++ b/challenge-100/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use 5.030;
-
+#!/usr/bin/env perl
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-101/paulo-custodio/test.pl b/challenge-101/paulo-custodio/test.pl
index 01ed2b83cd..ba6c37260b 100644
--- a/challenge-101/paulo-custodio/test.pl
+++ b/challenge-101/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use 5.030;
-
+#!/usr/bin/env perl
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-102/paulo-custodio/test.pl b/challenge-102/paulo-custodio/test.pl
index 01ed2b83cd..ba6c37260b 100644
--- a/challenge-102/paulo-custodio/test.pl
+++ b/challenge-102/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use 5.030;
-
+#!/usr/bin/env perl
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-103/paulo-custodio/test.pl b/challenge-103/paulo-custodio/test.pl
index 01ed2b83cd..ba6c37260b 100644
--- a/challenge-103/paulo-custodio/test.pl
+++ b/challenge-103/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use 5.030;
-
+#!/usr/bin/env perl
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-104/paulo-custodio/test.pl b/challenge-104/paulo-custodio/test.pl
index 01ed2b83cd..ba6c37260b 100644
--- a/challenge-104/paulo-custodio/test.pl
+++ b/challenge-104/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use 5.030;
-
+#!/usr/bin/env perl
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-105/paulo-custodio/test.pl b/challenge-105/paulo-custodio/test.pl
index 01ed2b83cd..ba6c37260b 100644
--- a/challenge-105/paulo-custodio/test.pl
+++ b/challenge-105/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use 5.030;
-
+#!/usr/bin/env perl
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-106/paulo-custodio/test.pl b/challenge-106/paulo-custodio/test.pl
index 01ed2b83cd..ba6c37260b 100644
--- a/challenge-106/paulo-custodio/test.pl
+++ b/challenge-106/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use 5.030;
-
+#!/usr/bin/env perl
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-107/paulo-custodio/test.pl b/challenge-107/paulo-custodio/test.pl
index cf1ced98e0..ba6c37260b 100755
--- a/challenge-107/paulo-custodio/test.pl
+++ b/challenge-107/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
#!/usr/bin/env perl
-
-use strict;
-use warnings;
-use 5.030;
-
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-108/paulo-custodio/test.pl b/challenge-108/paulo-custodio/test.pl
index cf1ced98e0..ba6c37260b 100755
--- a/challenge-108/paulo-custodio/test.pl
+++ b/challenge-108/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
#!/usr/bin/env perl
-
-use strict;
-use warnings;
-use 5.030;
-
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-109/paulo-custodio/test.pl b/challenge-109/paulo-custodio/test.pl
index cf1ced98e0..ba6c37260b 100755
--- a/challenge-109/paulo-custodio/test.pl
+++ b/challenge-109/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
#!/usr/bin/env perl
-
-use strict;
-use warnings;
-use 5.030;
-
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-110/paulo-custodio/test.pl b/challenge-110/paulo-custodio/test.pl
index cf1ced98e0..ba6c37260b 100755
--- a/challenge-110/paulo-custodio/test.pl
+++ b/challenge-110/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
#!/usr/bin/env perl
-
-use strict;
-use warnings;
-use 5.030;
-
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-111/paulo-custodio/test.pl b/challenge-111/paulo-custodio/test.pl
index cf1ced98e0..ba6c37260b 100755
--- a/challenge-111/paulo-custodio/test.pl
+++ b/challenge-111/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
#!/usr/bin/env perl
-
-use strict;
-use warnings;
-use 5.030;
-
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-112/paulo-custodio/test.pl b/challenge-112/paulo-custodio/test.pl
index cf1ced98e0..ba6c37260b 100755
--- a/challenge-112/paulo-custodio/test.pl
+++ b/challenge-112/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
#!/usr/bin/env perl
-
-use strict;
-use warnings;
-use 5.030;
-
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-113/paulo-custodio/test.pl b/challenge-113/paulo-custodio/test.pl
index cf1ced98e0..ba6c37260b 100755
--- a/challenge-113/paulo-custodio/test.pl
+++ b/challenge-113/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
#!/usr/bin/env perl
-
-use strict;
-use warnings;
-use 5.030;
-
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-114/paulo-custodio/test.pl b/challenge-114/paulo-custodio/test.pl
index cf1ced98e0..ba6c37260b 100755
--- a/challenge-114/paulo-custodio/test.pl
+++ b/challenge-114/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
#!/usr/bin/env perl
-
-use strict;
-use warnings;
-use 5.030;
-
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-115/paulo-custodio/test.pl b/challenge-115/paulo-custodio/test.pl
index cf1ced98e0..ba6c37260b 100755
--- a/challenge-115/paulo-custodio/test.pl
+++ b/challenge-115/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
#!/usr/bin/env perl
-
-use strict;
-use warnings;
-use 5.030;
-
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-116/paulo-custodio/test.pl b/challenge-116/paulo-custodio/test.pl
index cf1ced98e0..ba6c37260b 100755
--- a/challenge-116/paulo-custodio/test.pl
+++ b/challenge-116/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
#!/usr/bin/env perl
-
-use strict;
-use warnings;
-use 5.030;
-
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';
diff --git a/challenge-117/paulo-custodio/test.pl b/challenge-117/paulo-custodio/test.pl
index cf1ced98e0..ba6c37260b 100755
--- a/challenge-117/paulo-custodio/test.pl
+++ b/challenge-117/paulo-custodio/test.pl
@@ -1,7 +1,4 @@
#!/usr/bin/env perl
-
-use strict;
-use warnings;
-use 5.030;
-
+use Modern::Perl;
+use Test::More;
require '../../challenge-001/paulo-custodio/test.pl';