chiark / gitweb /
v0.06
[nailing-cargo.git] / t / toml-test / valid / table-array-implicit.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                'albums' => {
16                              'songs' => [
17                                           {
18                                             'name' => 'Glory Days'
19                                           }
20                                         ]
21                            }
22              };
23
24
25 my $actual = from_toml(q{[[albums.songs]]
26 name = "Glory Days"
27 });
28
29 is($actual, $expected1, 'table-array-implicit - from_toml') or do{
30   diag 'EXPECTED:';
31   diag Dumper($expected1);
32
33   diag 'ACTUAL:';
34   diag Dumper($actual);
35 };
36
37 is(eval{ from_toml(to_toml($actual)) }, $actual, 'table-array-implicit - to_toml') or do{
38   diag 'INPUT:';
39   diag Dumper($actual);
40
41   diag 'TOML OUTPUT:';
42   diag to_toml($actual);
43
44   diag 'REPARSED OUTPUT:';
45   diag Dumper(from_toml(to_toml($actual)));
46 };
47
48 done_testing;