File: 06_format_amf3_strict.t

package info (click to toggle)
libdata-amf-perl 0.09%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 544 kB
  • ctags: 527
  • sloc: perl: 5,955; makefile: 14
file content (42 lines) | stat: -rw-r--r-- 611 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
use Test::Base;

plan tests => 1 * blocks;

use FindBin;
use File::Spec;

use Data::AMF;

my $amf = Data::AMF->new( version => 3 );

sub serialize {
    $amf->serialize($_[0]->{data});
}

sub load {
    my $file = File::Spec->catfile( $FindBin::Bin, $_[0] );
    open my $fh, "<$file";
    my $data = do { local $/; <$fh> };
    close $fh;

    $data;
}

filters {
    input => [qw/yaml serialize/],
    expected => 'load',
};

run_compare;

__DATA__

=== null object
--- input
data: {}
--- expected: data/amf3/null_object

=== number with double precision
--- input
data: 123.45
--- expected: data/amf3/number