~ubuntu-branches/debian/sid/libsereal-encoder-perl/sid

« back to all changes in this revision

Viewing changes to t/120_hdr_data.t

  • Committer: Package Import Robot
  • Author(s): gregor herrmann
  • Date: 2014-06-06 13:17:09 UTC
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: package-import@ubuntu.com-20140606131709-ek9vy22c4sh5jgjx
Tags: upstream-3.001
ImportĀ upstreamĀ versionĀ 3.001

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
use strict;
3
3
use warnings;
4
4
use Sereal::Encoder qw(:all);
 
5
use Sereal::Encoder::Constants qw(:all);
5
6
use File::Spec;
6
7
use Scalar::Util qw( blessed );
7
8
use lib File::Spec->catdir(qw(t lib));
13
14
use Sereal::TestSet qw(:all);
14
15
use Test::More;
15
16
 
16
 
my $ref = Header(2, chr(0b0000_1100)) . chr(0b0001_0000); # -16 in body, 12 in header
 
17
my $ref = Header(SRL_PROTOCOL_VERSION, chr(0b0000_1100)) . chr(0b0001_0000); # -16 in body, 12 in header
17
18
is(encode_sereal_with_header_data(-16, 12), $ref, "Encode 12 in header, -16 in body");
18
19
is(Sereal::Encoder->new->encode(-16, 12), $ref, "OO: Encode 12 in header, -16 in body");
19
20