chiark / gitweb /
d26a5a3dc5e44acf62b67a0b64a07b3287edc8ec
[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 TOML::Tiny;
6
7 binmode STDIN,  ':encoding(UTF-8)';
8 binmode STDOUT, ':encoding(UTF-8)';
9
10 my $expected1 = {
11                'albums' => {
12                              'songs' => [
13                                           {
14                                             'name' => 'Glory Days'
15                                           }
16                                         ]
17                            }
18              };
19
20
21 my $actual = from_toml(q{[[albums.songs]]
22 name = "Glory Days"
23 });
24
25 is($actual, $expected1, 'table-array-implicit - from_toml') or do{
26   diag 'EXPECTED:';
27   diag Dumper($expected1);
28
29   diag 'ACTUAL:';
30   diag Dumper($actual);
31 };
32
33 is(eval{ from_toml(to_toml($actual)) }, $actual, 'table-array-implicit - to_toml') or do{
34   diag 'INPUT:';
35   diag Dumper($actual);
36
37   diag 'TOML OUTPUT:';
38   diag to_toml($actual);
39
40   diag 'REPARSED OUTPUT:';
41   diag Dumper(from_toml(to_toml($actual)));
42 };
43
44 done_testing;