| 1 | use strictscip-perl cpan Sereal-Encoder 5.006 strict/; |
| 2 | use warningsscip-perl cpan Sereal-Encoder 5.006 warnings/; |
| 3 | |
| 4 | use Test::Morescip-perl cpan Sereal-Encoder 5.006 Test/More/; |
| 5 | use File::Specscip-perl cpan Sereal-Encoder 5.006 File/Spec/; |
| 6 | use libscip-perl cpan Sereal-Encoder 5.006 lib/ File::Spec->catdir(qw(t lib)); |
| 7 | |
| 8 | BEGIN { |
| 9 | lib->importscip-perl cpan Sereal-Encoder 5.006 lib/import().('lib') |
| 10 | if !-d 't'; |
| 11 | } |
| 12 | use Sereal::TestSetscip-perl cpan Sereal-Encoder 5.006 Sereal/TestSet/ qw(:all); |
| 13 | my $problem = check_for_dependency_issuesscip-perl cpan Sereal-Encoder 5.006 main/check_for_dependency_issues().(); |
| 14 | if ( !$problem |
| 15 | or $problem !~ /available to test/ and $Sereal::Decoder::VERSIONscip-perl cpan Sereal-Encoder 5.006 Sereal/Decoder/$VERSION. and $Sereal::Encoder::VERSIONscip-perl cpan Sereal-Encoder 5.006 Sereal/Encoder/$VERSION. ) |
| 16 | { |
| 17 | planscip-perl cpan Sereal-Encoder 5.006 main/plan(). tests => 2; |
| 18 | } |
| 19 | else { |
| 20 | planscip-perl cpan Sereal-Encoder 5.006 main/plan(). skip_all => 'Must have both encoder and decoder to run this test.'; |
| 21 | } |
| 22 | diagscip-perl cpan Sereal-Encoder 5.006 main/diag(). "Testing with both encoder and decoder."; |
| 23 | diagscip-perl cpan Sereal-Encoder 5.006 main/diag(). "Sereal::Decoder v$Sereal::Decoder::VERSION"; |
| 24 | diagscip-perl cpan Sereal-Encoder 5.006 main/diag(). "Sereal::Encoder v$Sereal::Encoder::VERSION"; |
| 25 | my $show_diag; |
| 26 | cmp_okscip-perl cpan Sereal-Encoder 5.006 main/cmp_ok().( $Sereal::Encoder::VERSIONscip-perl cpan Sereal-Encoder 5.006 Sereal/Encoder/$VERSION., '<=', $Sereal::Decoder::VERSIONscip-perl cpan Sereal-Encoder 5.006 Sereal/Decoder/$VERSION., |
| 27 | "Check that Decoder version is newer or the same as Encoder" ) |
| 28 | or $show_diag++; |
| 29 | isscip-perl cpan Sereal-Encoder 5.006 main/is().( $problem, "", "There should be no Encoder/Decoder dependency problems." ) |
| 30 | or $show_diag++; |
| 31 | diagscip-perl cpan Sereal-Encoder 5.006 main/diag(). "If this test fails it means you need to upgrade Sereal::Decoder first!\n" |
| 32 | . "You are strongly advised to follow this guidance, upgrading the Encoder\n" |
| 33 | . "before you upgrade the Decoder may lead to serious problems\n\n" |
| 34 | . "YOU HAVE BEEN WARNED.\n\n" |
| 35 | if $show_diag; |