chiark / gitweb /
Move unused dependency to test deps
[nailing-cargo.git] / t / toml-test / valid / table-array-table-array.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                'a' => [
16                         {
17                           'b' => [
18                                    {
19                                      'c' => {
20                                               'd' => 'val0'
21                                             }
22                                    },
23                                    {
24                                      'c' => {
25                                               'd' => 'val1'
26                                             }
27                                    }
28                                  ]
29                         }
30                       ]
31              };
32
33
34 my $actual = from_toml(q{[[a]]
35     [[a.b]]
36         [a.b.c]
37             d = "val0"
38     [[a.b]]
39         [a.b.c]
40             d = "val1"
41 });
42
43 is($actual, $expected1, 'table-array-table-array - from_toml') or do{
44   diag 'EXPECTED:';
45   diag Dumper($expected1);
46
47   diag 'ACTUAL:';
48   diag Dumper($actual);
49 };
50
51 is(eval{ from_toml(to_toml($actual)) }, $actual, 'table-array-table-array - to_toml') or do{
52   diag 'INPUT:';
53   diag Dumper($actual);
54
55   diag 'TOML OUTPUT:';
56   diag to_toml($actual);
57
58   diag 'REPARSED OUTPUT:';
59   diag Dumper(from_toml(to_toml($actual)));
60 };
61
62 done_testing;