diff options
author | Steve Peters <steve@fisharerojo.org> | 2006-01-09 14:27:07 +0000 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2006-01-09 14:27:07 +0000 |
commit | 41c686de0da47eeb5df94342ffc739979e9aa57d (patch) | |
tree | 8a3987ed2f4a9b8efcd4161197dfa1c9dd03b817 /ext/Digest | |
parent | 33fb14dcecfb8ef90b19a0ecdf4894a1a64e0771 (diff) | |
download | perl-41c686de0da47eeb5df94342ffc739979e9aa57d.tar.gz |
Added standard core header to test cases for Digest::SHA
p4raw-id: //depot/perl@26755
Diffstat (limited to 'ext/Digest')
24 files changed, 162 insertions, 0 deletions
diff --git a/ext/Digest/SHA/t/0-pod-coverage.t b/ext/Digest/SHA/t/0-pod-coverage.t index f979796129..6059400c0e 100644 --- a/ext/Digest/SHA/t/0-pod-coverage.t +++ b/ext/Digest/SHA/t/0-pod-coverage.t @@ -1,4 +1,8 @@ BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } eval "use Test::More"; if ($@) { print "1..0 # Skipped: Test::More not installed\n"; diff --git a/ext/Digest/SHA/t/0-pod.t b/ext/Digest/SHA/t/0-pod.t index 1ec6bff52b..cb640fa02b 100644 --- a/ext/Digest/SHA/t/0-pod.t +++ b/ext/Digest/SHA/t/0-pod.t @@ -1,4 +1,9 @@ BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } + eval "use Test::More"; if ($@) { print "1..0 # Skipped: Test::More not installed\n"; diff --git a/ext/Digest/SHA/t/1-exist.t b/ext/Digest/SHA/t/1-exist.t index 07ced0ec2a..82c9d2027d 100644 --- a/ext/Digest/SHA/t/1-exist.t +++ b/ext/Digest/SHA/t/1-exist.t @@ -1,5 +1,12 @@ use Test; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + BEGIN { plan tests => 1 } use Digest::SHA qw( diff --git a/ext/Digest/SHA/t/1-hello-world.t b/ext/Digest/SHA/t/1-hello-world.t index 6e5a0e65d3..4bf2392789 100644 --- a/ext/Digest/SHA/t/1-hello-world.t +++ b/ext/Digest/SHA/t/1-hello-world.t @@ -2,6 +2,12 @@ use Test; use Digest::SHA qw(sha1); use strict; use integer; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} my(@vec, @rsp); diff --git a/ext/Digest/SHA/t/2-nist-sha-1.t b/ext/Digest/SHA/t/2-nist-sha-1.t index 18165bc6c1..a91080e6bf 100644 --- a/ext/Digest/SHA/t/2-nist-sha-1.t +++ b/ext/Digest/SHA/t/2-nist-sha-1.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA qw(sha1_hex); +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@vec, @rsp); BEGIN { diff --git a/ext/Digest/SHA/t/2-nist-sha-224.t b/ext/Digest/SHA/t/2-nist-sha-224.t index a1d4d8cf00..7dc5a1869e 100644 --- a/ext/Digest/SHA/t/2-nist-sha-224.t +++ b/ext/Digest/SHA/t/2-nist-sha-224.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA qw(sha224_hex); +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@vec, @rsp); BEGIN { diff --git a/ext/Digest/SHA/t/2-nist-sha-256.t b/ext/Digest/SHA/t/2-nist-sha-256.t index b4eeb67aa3..a7d5d0ceeb 100644 --- a/ext/Digest/SHA/t/2-nist-sha-256.t +++ b/ext/Digest/SHA/t/2-nist-sha-256.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA qw(sha256_hex); +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@vec, @rsp); BEGIN { diff --git a/ext/Digest/SHA/t/2-nist-sha-384.t b/ext/Digest/SHA/t/2-nist-sha-384.t index b993ca2a98..2ffd737db3 100644 --- a/ext/Digest/SHA/t/2-nist-sha-384.t +++ b/ext/Digest/SHA/t/2-nist-sha-384.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA qw(sha384_hex); +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@vec, @rsp); BEGIN { diff --git a/ext/Digest/SHA/t/2-nist-sha-512.t b/ext/Digest/SHA/t/2-nist-sha-512.t index b3317b818b..f5fd31162c 100644 --- a/ext/Digest/SHA/t/2-nist-sha-512.t +++ b/ext/Digest/SHA/t/2-nist-sha-512.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA qw(sha512_hex); +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@vec, @rsp); BEGIN { diff --git a/ext/Digest/SHA/t/2-nist-sha-base64.t b/ext/Digest/SHA/t/2-nist-sha-base64.t index e3e9cda9ca..8eccb80c37 100644 --- a/ext/Digest/SHA/t/2-nist-sha-base64.t +++ b/ext/Digest/SHA/t/2-nist-sha-base64.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA qw(sha1_base64 sha224_base64 sha256_base64 sha384_base64 sha512_base64); +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@vec, $data); BEGIN { diff --git a/ext/Digest/SHA/t/2-nist-sha-oo.t b/ext/Digest/SHA/t/2-nist-sha-oo.t index 72f6243769..7af2edba13 100644 --- a/ext/Digest/SHA/t/2-nist-sha-oo.t +++ b/ext/Digest/SHA/t/2-nist-sha-oo.t @@ -5,6 +5,13 @@ use File::Basename qw(dirname); use File::Spec; use Digest::SHA; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@vec); BEGIN { diff --git a/ext/Digest/SHA/t/2-nist-vectors-bit.t b/ext/Digest/SHA/t/2-nist-vectors-bit.t index dfa133de41..b17ad12566 100644 --- a/ext/Digest/SHA/t/2-nist-vectors-bit.t +++ b/ext/Digest/SHA/t/2-nist-vectors-bit.t @@ -12,6 +12,13 @@ use File::Basename qw(dirname); use File::Spec; use Digest::SHA; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my @hashes; BEGIN { diff --git a/ext/Digest/SHA/t/2-nist-vectors-byte.t b/ext/Digest/SHA/t/2-nist-vectors-byte.t index 8c817c0a05..51bae67b07 100644 --- a/ext/Digest/SHA/t/2-nist-vectors-byte.t +++ b/ext/Digest/SHA/t/2-nist-vectors-byte.t @@ -12,6 +12,13 @@ use File::Basename qw(dirname); use File::Spec; use Digest::SHA; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my @hashes; BEGIN { diff --git a/ext/Digest/SHA/t/3-gillogly-easy.t b/ext/Digest/SHA/t/3-gillogly-easy.t index 603c7ec1a2..4a473630ef 100644 --- a/ext/Digest/SHA/t/3-gillogly-easy.t +++ b/ext/Digest/SHA/t/3-gillogly-easy.t @@ -7,6 +7,13 @@ use strict; use integer; use Digest::SHA; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + # SHA-1 Test Vectors # # In the following we use the notation bitstring#n to mean a bitstring diff --git a/ext/Digest/SHA/t/3-gillogly-hard.t b/ext/Digest/SHA/t/3-gillogly-hard.t index db10a94b3c..372f7c1ded 100644 --- a/ext/Digest/SHA/t/3-gillogly-hard.t +++ b/ext/Digest/SHA/t/3-gillogly-hard.t @@ -9,6 +9,13 @@ use File::Basename qw(dirname); use File::Spec; use Digest::SHA; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + # SHA-1 Test Vectors # # In the following we use the notation bitstring#n to mean a bitstring diff --git a/ext/Digest/SHA/t/4-bitstr-increasing.t b/ext/Digest/SHA/t/4-bitstr-increasing.t index 160a344511..de39d79f71 100644 --- a/ext/Digest/SHA/t/4-bitstr-increasing.t +++ b/ext/Digest/SHA/t/4-bitstr-increasing.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + BEGIN { plan tests => 1 } my $i; diff --git a/ext/Digest/SHA/t/4-bitstr-large.t b/ext/Digest/SHA/t/4-bitstr-large.t index e1220adc1d..7ccc7a6310 100644 --- a/ext/Digest/SHA/t/4-bitstr-large.t +++ b/ext/Digest/SHA/t/4-bitstr-large.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + BEGIN { plan tests => 1 } my $i; diff --git a/ext/Digest/SHA/t/4-bitstr-random.t b/ext/Digest/SHA/t/4-bitstr-random.t index 8c71c5a75c..cf4be92e32 100644 --- a/ext/Digest/SHA/t/4-bitstr-random.t +++ b/ext/Digest/SHA/t/4-bitstr-random.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + BEGIN { plan tests => 1 } my $reps = 8000000; diff --git a/ext/Digest/SHA/t/5-hmac-fips198.t b/ext/Digest/SHA/t/5-hmac-fips198.t index a6af3425fc..422f4857c8 100644 --- a/ext/Digest/SHA/t/5-hmac-fips198.t +++ b/ext/Digest/SHA/t/5-hmac-fips198.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA qw(hmac_sha1_hex); +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@vec); BEGIN { diff --git a/ext/Digest/SHA/t/5-hmac-rfc2202.t b/ext/Digest/SHA/t/5-hmac-rfc2202.t index 6e77f3d6bc..a3cc281ce5 100644 --- a/ext/Digest/SHA/t/5-hmac-rfc2202.t +++ b/ext/Digest/SHA/t/5-hmac-rfc2202.t @@ -3,6 +3,13 @@ use strict; use integer; use Digest::SHA qw(hmac_sha1_hex); +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@vec); BEGIN { diff --git a/ext/Digest/SHA/t/5-hmac-sha-256.t b/ext/Digest/SHA/t/5-hmac-sha-256.t index 55731c8bb8..619ce0c0aa 100644 --- a/ext/Digest/SHA/t/5-hmac-sha-256.t +++ b/ext/Digest/SHA/t/5-hmac-sha-256.t @@ -5,6 +5,13 @@ use strict; use integer; use Digest::SHA qw(hmac_sha256_hex); +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@data); BEGIN { diff --git a/ext/Digest/SHA/t/5-hmac-woodbury.t b/ext/Digest/SHA/t/5-hmac-woodbury.t index d71af92cfe..a9b96287ee 100644 --- a/ext/Digest/SHA/t/5-hmac-woodbury.t +++ b/ext/Digest/SHA/t/5-hmac-woodbury.t @@ -7,6 +7,13 @@ use strict; use integer; use Digest::SHA qw(hmac_sha256_hex hmac_sha384_hex hmac_sha512_hex); +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + BEGIN { plan tests => 21 } # Use RFC 2202 data/key values for 512-bit blocks diff --git a/ext/Digest/SHA/t/6-dump-load.t b/ext/Digest/SHA/t/6-dump-load.t index c369ac18e2..07d4774e06 100644 --- a/ext/Digest/SHA/t/6-dump-load.t +++ b/ext/Digest/SHA/t/6-dump-load.t @@ -5,6 +5,13 @@ use Digest::SHA qw(sha384_hex sha512_hex); use File::Basename qw(dirname); use File::Spec; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + my(@sharsp); BEGIN { diff --git a/ext/Digest/SHA/t/7-ireland.t b/ext/Digest/SHA/t/7-ireland.t index 76ca9e2ee3..5ddbcfd01c 100644 --- a/ext/Digest/SHA/t/7-ireland.t +++ b/ext/Digest/SHA/t/7-ireland.t @@ -4,6 +4,13 @@ use File::Basename qw(dirname); use File::Spec; use Digest::SHA; +BEGIN { + if ($ENV{PERL_CORE}) { + chdir 't' if -d 't'; + @INC = '../lib'; + } +} + # David Ireland's test vector - SHA-256 digest of "a" x 536870912 # Adapted from Julius Duque's original script (t/24-ireland.tmp) |