[SCM] Debian packaging of Crypt-ECB CPAN distribution branch, master, updated. debian/1.40-2-12-g2dbbe1d

Xavier x.guimard at free.fr
Fri Dec 28 09:09:53 UTC 2012


The following commit has been merged in the master branch:
commit 994d939094165e15ee8dd11c851ea2eb168ac9e1
Author: Xavier <x.guimard at free.fr>
Date:   Fri Dec 28 10:08:17 2012 +0100

    Replace tests using Test::More

diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..d88ceb7
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+use-standard-tests.patch
diff --git a/debian/patches/use-standard-tests.patch b/debian/patches/use-standard-tests.patch
new file mode 100644
index 0000000..87711f1
--- /dev/null
+++ b/debian/patches/use-standard-tests.patch
@@ -0,0 +1,460 @@
+Description: Use standards tests
+Author: Xavier Guimard <x.guimard at free.fr>
+Bug: https://rt.cpan.org/Ticket/Display.html?id=82301
+Forwarded: https://rt.cpan.org/Ticket/Display.html?id=82301
+Last-Update: 2012-12-28
+
+--- a/t/70-funcstyle.t
++++ b/t/70-funcstyle.t
+@@ -1,6 +1,6 @@
+ #!/usr/bin/perl -w
+ 
+-use Crypt::ECB qw(encrypt decrypt PADDING_AUTO);
++#use Crypt::ECB qw(encrypt decrypt PADDING_AUTO);
+ 
+ my @ciphers =
+ (
+@@ -18,7 +18,11 @@
+ 	'Twofish2',
+ );
+ 
+-print "1..", $#ciphers+1, "\n";
++use Test::More tests=>37;
++
++#print "1..", $#ciphers+1, "\n";
++
++BEGIN { use_ok (Crypt::ECB, qw(encrypt decrypt PADDING_AUTO)) };
+ 
+ my ($crypt, $cipher, $key, $ks, $len, $nok, $enc1, $enc2, $dec1, $dec2, $test);
+ 
+@@ -31,27 +35,25 @@
+ 
+ foreach $cipher (@ciphers)
+ {
+-	unless ($crypt->cipher($cipher))
+-	{
+-		print "ok ".(++$test)." # skip, $cipher not installed\n";
+-		next;
+-	}
++	SKIP: {
++	skip "$cipher not installed", 3 unless($crypt->cipher($cipher));
+ 
+ 	$ks = ($crypt->{Keysize} or 8);
+ 	$key = substr($xkey, 0, $ks);
+ 	$crypt->key($key);
+ 
+-	$nok = 0;
++	#$nok = 0;
+ 
+ 	$enc1 = $crypt->encrypt($text);
+ 	$enc2 = encrypt($key, $cipher, $text, PADDING_AUTO);
+-	$nok++ unless ($enc1 eq $enc2);
++	ok($enc1 eq $enc2);
+ 
+ 	$dec1 = $crypt->decrypt($enc1);
+ 	$dec2 = decrypt($key, $cipher, $enc2, PADDING_AUTO);
+-	$nok++ unless ($dec1 eq $text);
+-	$nok++ unless ($dec2 eq $text);
++	ok($dec1 eq $text);
++	ok($dec2 eq $text);
+ 
+-	print "not " if $nok;
+-	print "ok ".(++$test)."\n";
++	#print "not " if $nok;
++	#print "ok ".(++$test)."\n";
++	}
+ }
+--- a/t/65-nullblock-2.t
++++ b/t/65-nullblock-2.t
+@@ -1,6 +1,6 @@
+ #!/usr/bin/perl -w
+ 
+-use Crypt::ECB;
++#use Crypt::ECB;
+ 
+ my @ciphers =
+ (
+@@ -18,7 +18,11 @@
+ 	'Twofish2',
+ );
+ 
+-print "1..", $#ciphers+1, "\n";
++use Test::More tests=>13;
++
++#print "1..", $#ciphers+1, "\n";
++
++BEGIN { use_ok (Crypt::ECB) };
+ 
+ my ($crypt, $cipher, $ks, $len, $nok, $enc, $dec, $test);
+ 
+@@ -31,20 +35,18 @@
+ 
+ foreach $cipher (@ciphers)
+ {
+-	unless ($crypt->cipher($cipher))
+-	{
+-		print "ok ".(++$test)." # skip, $cipher not installed\n";
+-		next;
+-	}
++	SKIP: {
++	skip "$cipher not installed", 1 unless($crypt->cipher($cipher));
+ 
+ 	$ks = ($crypt->{Keysize} or 8);
+ 	$crypt->key(substr($key,0,$ks));
+ 
+-	$nok = 0;
++	#$nok = 0;
+ 
+ 	$enc = $crypt->encrypt($text);
+-	$nok++ unless $crypt->decrypt($enc) eq $text;
++	ok($crypt->decrypt($enc) eq $text);
+ 
+-	print "not " if $nok;
+-	print "ok ".(++$test)."\n";
++	#print "not " if $nok;
++	#print "ok ".(++$test)."\n";
++	}
+ }
+--- a/t/40-substr.t
++++ b/t/40-substr.t
+@@ -1,6 +1,6 @@
+ #!/usr/bin/perl -w
+ 
+-use Crypt::ECB;
++#use Crypt::ECB;
+ 
+ my @ciphers =
+ (
+@@ -18,7 +18,11 @@
+ 	'Twofish2',
+ );
+ 
+-print "1..", $#ciphers+1, "\n";
++use Test::More tests=>13;
++
++#print "1..", $#ciphers+1, "\n";
++
++BEGIN { use_ok (Crypt::ECB) };
+ 
+ my ($crypt, $cipher, $ks, $len, $nok, $enc, $dec, $test);
+ 
+@@ -31,11 +35,8 @@
+ 
+ foreach $cipher (@ciphers)
+ {
+-	unless ($crypt->cipher($cipher))
+-	{
+-		print "ok ".(++$test)." # skip, $cipher not installed\n";
+-		next;
+-	}
++	SKIP: {
++	skip "$cipher not installed", 1 unless($crypt->cipher($cipher));
+ 
+ 	$ks = ($crypt->{Keysize} or 8);
+ 	$crypt->key(substr($key,0,$ks));
+@@ -47,6 +48,8 @@
+ 		$dec = $crypt->decrypt($enc);
+ 		$nok++ unless substr($text,0,$len) eq $dec;
+ 	}
+-	print "not " if $nok;
+-	print "ok ".(++$test)."\n";
++	ok($nok == 0);
++	#print "not " if $nok;
++	#print "ok ".(++$test)."\n";
++	}
+ }
+--- a/t/60-nullblock-1.t
++++ b/t/60-nullblock-1.t
+@@ -1,6 +1,6 @@
+ #!/usr/bin/perl -w
+ 
+-use Crypt::ECB;
++#use Crypt::ECB;
+ 
+ my @ciphers =
+ (
+@@ -18,7 +18,11 @@
+ 	'Twofish2',
+ );
+ 
+-print "1..", $#ciphers+1, "\n";
++use Test::More tests=>13;
++
++#print "1..", $#ciphers+1, "\n";
++
++BEGIN { use_ok (Crypt::ECB) };
+ 
+ my ($crypt, $cipher, $ks, $len, $nok, $enc, $dec, $test);
+ 
+@@ -31,20 +35,18 @@
+ 
+ foreach $cipher (@ciphers)
+ {
+-	unless ($crypt->cipher($cipher))
+-	{
+-		print "ok ".(++$test)." # skip, $cipher not installed\n";
+-		next;
+-	}
++	SKIP: {
++	skip "$cipher not installed", 1 unless($crypt->cipher($cipher));
+ 
+ 	$ks = ($crypt->{Keysize} or 8);
+ 	$crypt->key(substr($key,0,$ks));
+ 
+-	$nok = 0;
++	#$nok = 0;
+ 
+ 	$enc = $crypt->encrypt($text);
+-	$nok++ unless $crypt->decrypt($enc) eq $text;
++	ok($crypt->decrypt($enc) eq $text);
+ 
+-	print "not " if $nok;
+-	print "ok ".(++$test)."\n";
++	#print "not " if $nok;
++	#print "ok ".(++$test)."\n";
++	}
+ }
+--- a/t/75-funcstyle-nullblock.t
++++ b/t/75-funcstyle-nullblock.t
+@@ -1,6 +1,6 @@
+ #!/usr/bin/perl -w
+ 
+-use Crypt::ECB qw(encrypt decrypt PADDING_AUTO);
++#use Crypt::ECB qw(encrypt decrypt PADDING_AUTO);
+ 
+ my @ciphers =
+ (
+@@ -18,7 +18,11 @@
+ 	'Twofish2',
+ );
+ 
+-print "1..", $#ciphers+1, "\n";
++use Test::More tests=>37;
++
++#print "1..", $#ciphers+1, "\n";
++
++BEGIN { use_ok (Crypt::ECB, qw(encrypt decrypt PADDING_AUTO)) };
+ 
+ my ($crypt, $cipher, $key, $ks, $len, $nok, $enc1, $enc2, $dec1, $dec2, $test);
+ 
+@@ -31,27 +35,25 @@
+ 
+ foreach $cipher (@ciphers)
+ {
+-	unless ($crypt->cipher($cipher))
+-	{
+-		print "ok ".(++$test)." # skip, $cipher not installed\n";
+-		next;
+-	}
++	SKIP: {
++	skip "$cipher not installed", 3 unless($crypt->cipher($cipher));
+ 
+ 	$ks = ($crypt->{Keysize} or 8);
+ 	$key = substr($xkey, 0, $ks);
+ 	$crypt->key($key);
+ 
+-	$nok = 0;
++	#$nok = 0;
+ 
+ 	$enc1 = $crypt->encrypt($text);
+ 	$enc2 = encrypt($key, $cipher, $text, PADDING_AUTO);
+-	$nok++ unless ($enc1 eq $enc2);
++	ok($enc1 eq $enc2);
+ 
+ 	$dec1 = $crypt->decrypt($enc1);
+ 	$dec2 = decrypt($key, $cipher, $enc2, PADDING_AUTO);
+-	$nok++ unless ($dec1 eq $text);
+-	$nok++ unless ($dec2 eq $text);
++	ok($dec1 eq $text);
++	ok($dec2 eq $text);
+ 
+-	print "not " if $nok;
+-	print "ok ".(++$test)."\n";
++	#print "not " if $nok;
++	#print "ok ".(++$test)."\n";
++	}
+ }
+--- a/t/30-padding.t
++++ b/t/30-padding.t
+@@ -1,6 +1,6 @@
+ #!/usr/bin/perl -w
+ 
+-use Crypt::ECB;
++#use Crypt::ECB;
+ 
+ my @ciphers =
+ (
+@@ -18,7 +18,11 @@
+ 	'Twofish2',
+ );
+ 
+-print "1..", $#ciphers+1, "\n";
++use Test::More tests=>25;
++
++#print "1..", $#ciphers+1, "\n";
++
++BEGIN { use_ok (Crypt::ECB) };
+ 
+ my ($crypt, $cipher, $ks, $len, $nok, $enc, $dec, $test);
+ 
+@@ -29,24 +33,24 @@
+ 
+ foreach $cipher (@ciphers)
+ {
+-	unless ($crypt->cipher($cipher))
+-	{
+-		print "ok ".(++$test)." # skip, $cipher not installed\n";
+-		next;
+-	}
++	SKIP: {
++	skip "$cipher not installed", 2 unless($crypt->cipher($cipher));
+ 
+ 	$ks = ($crypt->{Keysize} or 8);
+ 	$crypt->key(substr($key,0,$ks));
+ 
+-	$nok = 0;
++	#$nok = 0;
+ 
+ 	$crypt->padding(PADDING_AUTO);
+ 	$enc = $crypt->encrypt($text);
+-	$nok++ unless $crypt->decrypt($enc) eq $text;
++    ok($crypt->decrypt($enc) eq $text);
++	#$nok++ unless $crypt->decrypt($enc) eq $text;
+ 
+ 	$crypt->padding(PADDING_NONE);
+-	$nok++ unless $crypt->decrypt($enc) eq $text."\x02\x02";
++	ok($crypt->decrypt($enc) eq $text."\x02\x02");
++	#$nok++ unless $crypt->decrypt($enc) eq $text."\x02\x02";
+ 
+-	print "not " if $nok;
+-	print "ok ".(++$test)."\n";
++	#print "not " if $nok;
++	#print "ok ".(++$test)."\n";
++	}
+ }
+--- a/t/10-encryption.t
++++ b/t/10-encryption.t
+@@ -19,9 +19,11 @@
+ #	'Twofish2',	'0958c674179aefaf13de8b25a613174dc40a90b80918bce55d314c86ecd3db45',
+ );
+ 
+-print "1..", scalar(keys %data), "\n";
++use Test::More tests=>12;
+ 
+-use Crypt::ECB;
++#print "1..", scalar(keys %data), "\n";
++
++BEGIN { use_ok (Crypt::ECB) };
+ 
+ my ($crypt, $cipher, $ks, $enc, $test);
+ 
+@@ -34,16 +36,15 @@
+ 
+ foreach $cipher (sort keys %data)
+ {
+-	unless ($crypt->cipher($cipher))
+-	{
+-		print "ok ".(++$test)." # skip, $cipher not installed\n";
+-		next;
+-	}
++	SKIP: {
++	skip "$cipher not installed", 1 unless($crypt->cipher($cipher));
+ 
+ 	$ks = ($crypt->{Keysize} or 8);
+ 	$crypt->key(substr($key,0,$ks));
+ 
+ 	$enc = $crypt->encrypt_hex($text);
+-	print "not " unless $enc eq $data{$cipher};
+-	print "ok ".(++$test)."\n";
++	ok($enc eq $data{$cipher});
++	#print "not " unless $enc eq $data{$cipher};
++	#print "ok ".(++$test)."\n";
++	}
+ }
+--- a/t/50-caching.t
++++ b/t/50-caching.t
+@@ -1,6 +1,6 @@
+ #!/usr/bin/perl -w
+ 
+-use Crypt::ECB;
++#use Crypt::ECB;
+ 
+ my @ciphers =
+ (
+@@ -18,7 +18,11 @@
+ 	'Twofish2',
+ );
+ 
+-print "1..", $#ciphers+1, "\n";
++use Test::More tests=>13;
++
++#print "1..", $#ciphers+1, "\n";
++
++BEGIN { use_ok (Crypt::ECB) };
+ 
+ my ($crypt, $cipher, $ks, $len, $nok, $enc, $dec, $test);
+ 
+@@ -31,11 +35,8 @@
+ 
+ foreach $cipher (@ciphers)
+ {
+-	unless ($crypt->cipher($cipher))
+-	{
+-		print "ok ".(++$test)." # skip, $cipher not installed\n";
+-		next;
+-	}
++	SKIP: {
++	skip "$cipher not installed", 1 unless($crypt->cipher($cipher));
+ 
+ 	$ks = ($crypt->{Keysize} or 8);
+ 	$crypt->key(substr($key,0,$ks));
+@@ -54,6 +55,8 @@
+ 
+ 		$nok++ unless $text eq $dec;
+ 	}
+-	print "not " if $nok;
+-	print "ok ".(++$test)."\n";
++	ok($nok==0);
++	#print "not " if $nok;
++	#print "ok ".(++$test)."\n";
++	}
+ }
+--- a/t/20-decryption.t
++++ b/t/20-decryption.t
+@@ -19,9 +19,11 @@
+ #	'Twofish2',	'0958c674179aefaf13de8b25a613174dc40a90b80918bce55d314c86ecd3db45',
+ );
+ 
+-print "1..", scalar(keys %data), "\n";
++use Test::More tests=>12;
+ 
+-use Crypt::ECB;
++#print "1..", scalar(keys %data), "\n";
++
++BEGIN { use_ok (Crypt::ECB) };
+ 
+ my ($crypt, $cipher, $ks, $dec, $test);
+ 
+@@ -34,16 +36,15 @@
+ 
+ foreach $cipher (sort keys %data)
+ {
+-	unless ($crypt->cipher($cipher))
+-	{
+-		print "ok ".(++$test)." # skip, $cipher not installed\n";
+-		next;
+-	}
++	SKIP: {
++	skip "$cipher not installed", 1 unless($crypt->cipher($cipher));
+ 
+ 	$ks = ($crypt->{Keysize} or 8);
+ 	$crypt->key(substr($key,0,$ks));
+ 
+ 	$dec = $crypt->decrypt_hex($data{$cipher});
+-	print "not " unless $dec eq $text;
+-	print "ok ".(++$test)."\n";
++	ok($dec eq $text);
++	#print "not " unless $dec eq $text;
++	#print "ok ".(++$test)."\n";
++    }
+ }

-- 
Debian packaging of Crypt-ECB CPAN distribution



More information about the Pkg-perl-cvs-commits mailing list