chiark / gitweb /
f8a9c832e6a332eacda8e2f059287a8839585ea5
[nailing-cargo.git] / t / toml-test / valid / table-array-one.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                'people' => [
12                              {
13                                'first_name' => 'Bruce',
14                                'last_name' => 'Springsteen'
15                              }
16                            ]
17              };
18
19
20 my $actual = from_toml(q{[[people]]
21 first_name = "Bruce"
22 last_name = "Springsteen"
23 });
24
25 is($actual, $expected1, 'table-array-one - 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-one - 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;