chiark / gitweb /
v0.06
[nailing-cargo.git] / t / toml-test / valid / array-nospaces.t
1 # File automatically generated from BurntSushi/toml-test
2 use utf8;
3 use Test2::V0;
4 use Data::Dumper;
5 use DateTime;
6 use DateTime::Format::RFC3339;
7 use Math::BigInt;
8 use Math::BigFloat;
9 use TOML::Tiny;
10
11 binmode STDIN,  ':encoding(UTF-8)';
12 binmode STDOUT, ':encoding(UTF-8)';
13
14 my $expected1 = {
15                'ints' => [
16                            bless( {
17                                     'name' => '<Custom Code>',
18                                     'operator' => 'CODE(...)',
19                                     '_file' => '(eval 47)',
20                                     'code' => sub {
21                                                   BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
22                                                   use strict;
23                                                   no feature ':all';
24                                                   use feature ':5.16';
25                                                   require Math::BigInt;
26                                                   'Math::BigInt'->new('1')->beq($_);
27                                               },
28                                     '_lines' => [
29                                                   6
30                                                 ]
31                                   }, 'Test2::Compare::Custom' ),
32                            bless( {
33                                     'name' => '<Custom Code>',
34                                     'operator' => 'CODE(...)',
35                                     '_file' => '(eval 112)',
36                                     'code' => sub {
37                                                   BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
38                                                   use strict;
39                                                   no feature ':all';
40                                                   use feature ':5.16';
41                                                   require Math::BigInt;
42                                                   'Math::BigInt'->new('2')->beq($_);
43                                               },
44                                     '_lines' => [
45                                                   6
46                                                 ]
47                                   }, 'Test2::Compare::Custom' ),
48                            bless( {
49                                     'operator' => 'CODE(...)',
50                                     'name' => '<Custom Code>',
51                                     'code' => sub {
52                                                   BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
53                                                   use strict;
54                                                   no feature ':all';
55                                                   use feature ':5.16';
56                                                   require Math::BigInt;
57                                                   'Math::BigInt'->new('3')->beq($_);
58                                               },
59                                     '_file' => '(eval 113)',
60                                     '_lines' => [
61                                                   6
62                                                 ]
63                                   }, 'Test2::Compare::Custom' )
64                          ]
65              };
66
67
68 my $actual = from_toml(q{ints = [1,2,3]
69 });
70
71 is($actual, $expected1, 'array-nospaces - from_toml') or do{
72   diag 'EXPECTED:';
73   diag Dumper($expected1);
74
75   diag 'ACTUAL:';
76   diag Dumper($actual);
77 };
78
79 is(eval{ from_toml(to_toml($actual)) }, $actual, 'array-nospaces - to_toml') or do{
80   diag 'INPUT:';
81   diag Dumper($actual);
82
83   diag 'TOML OUTPUT:';
84   diag to_toml($actual);
85
86   diag 'REPARSED OUTPUT:';
87   diag Dumper(from_toml(to_toml($actual)));
88 };
89
90 done_testing;