~ubuntu-branches/ubuntu/wily/libsereal-encoder-perl/wily

« back to all changes in this revision

Viewing changes to t/700_roundtrip/v3/plain.t

  • Committer: Package Import Robot
  • Author(s): gregor herrmann
  • Date: 2014-07-27 22:25:25 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20140727222525-12re0k54e36px9g1
Tags: 3.001.004-1
* Team upload.
* New upstream release.
  Further improvements for non-x86 architectures.
* Bump versioned build dependency on libsereal-decoder-perl.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!perl
 
2
use strict;
 
3
use warnings;
 
4
use Sereal::Decoder;
 
5
use Data::Dumper;
 
6
use File::Spec;
 
7
 
 
8
# These tests use an installed Decoder (or respectively Encoder) to do
 
9
# round-trip testing. There are two strategies, both with drawbacks:
 
10
# - Test::More's is_deeply is waaaay too lenient to catch all the
 
11
#   subtleties that Sereal is supposed to encode.
 
12
# - Serialize - Deserialize - Serialize, then do a string compare.
 
13
#   This won't catch if the first serialization has bogus output
 
14
#   but the subsequent de- & serialization work for the already
 
15
#   bogus output.
 
16
# These tests can't replace carefully crafted manual tests, I fear.
 
17
 
 
18
use lib File::Spec->catdir(qw(t lib));
 
19
BEGIN {
 
20
    lib->import('lib')
 
21
        if !-d 't';
 
22
}
 
23
 
 
24
use Sereal::TestSet qw(:all);
 
25
use Test::More;
 
26
 
 
27
my $version;
 
28
 
 
29
my $ok = have_encoder_and_decoder();
 
30
if (not $ok) {
 
31
    plan skip_all => 'Did not find right version of encoder';
 
32
}
 
33
else {
 
34
    run_roundtrip_tests("plain");
 
35
}
 
36
 
 
37
pass();
 
38
done_testing();
 
39