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