File: 02_format_amf0_simple.t

package info (click to toggle)
libdata-amf-perl 0.09%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 552 kB
  • ctags: 527
  • sloc: perl: 5,955; makefile: 10
file content (93 lines) | stat: -rw-r--r-- 1,034 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
use Test::Base;

plan tests => 1 * blocks;

use Data::AMF;

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

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

sub deserialize {
    my ($data) = $amf->deserialize($_[0]);
    return { data => $data };
}

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

run_compare input => 'input';

__DATA__

=== number
--- input
data: 123

=== boolean true
--- SKIP: currently not supported to format boolean
--- input
data: 1

=== boolean false
--- SKIP: currently not supported to format boolean
--- input
data: 0

=== string
--- input
data: foo

=== object
--- input
data:
  foo: bar

=== null object
--- input
data: {}

=== object2
--- input
data:
  array:
    - foo
    - bar
  hash:
    foo: bar

=== null
--- input
data: ~

=== undefined
--- input
data: ~

=== reference
--- SKIP

=== ecma array
--- input
data:
  0: foo
  bar: baz

=== strict-array
--- input
data:
  - foo
  - bar
  - baz

=== date
--- input
data: 1216717318745

=== long string
--- SKIP