11use strict;
22use warnings;
3- use Test::More tests => 6;
43use XML::Enc;
4+ use Test::More;
55use MIME::Base64 qw/ decode_base64/ ;
66
77my $base64 = <<'BASE64AES' ;
@@ -10,16 +10,14 @@ BASE64AES
1010
1111my $xml = decode_base64($base64 );
1212
13- ok($xml , " Got encrypted AES XML" );
14-
1513my $decrypter = XML::Enc-> new(
1614 {
1715 key => ' t/sign-private.pem' ,
1816 no_xml_declaration => 1
1917 }
2018);
2119
22- ok ($decrypter -> decrypt($xml ) =~ / 68351fcad4f2/ , " Successfully Decrypted AES" );
20+ like ($decrypter -> decrypt($xml ), qr / 68351fcad4f2/ , " Successfully Decrypted AES" );
2321
2422$base64 = <<'BASE64DES' ;
2523PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0
@@ -217,16 +215,14 @@ BASE64DES
217215
218216$xml = decode_base64($base64 );
219217
220- ok($xml , " Got encrypted DES XML" );
221-
222218$decrypter = XML::Enc-> new(
223219 {
224220 key => ' t/sign-private.pem' ,
225221 no_xml_declaration => 1
226222 }
227223);
228224
229- ok ($decrypter -> decrypt($xml ) =~ / 5e08ab4870dfd2f2a/ , " Successfully Decrypted DES" );
225+ like ($decrypter -> decrypt($xml ), qr / 5e08ab4870dfd2f2a/ , " Successfully Decrypted DES" );
230226
231227
232228$base64 = <<'FIRSTGO' ;
@@ -267,15 +263,13 @@ FIRSTGO
267263
268264$xml = decode_base64($base64 );
269265
270- ok($xml , " Got encrypted DES XML" );
271-
272266$decrypter = XML::Enc-> new(
273267 {
274268 key => ' t/sign-private.pem' ,
275269 no_xml_declaration => 1
276270 }
277271);
278272
279- ok ($decrypter -> decrypt($xml ) =~ / XML-SIG_1/ , " Successfully Decrypted DES" );
273+ like ($decrypter -> decrypt($xml ), qr / XML-SIG_1/ , " Successfully Decrypted DES" );
280274
281275done_testing;
0 commit comments