chiark / gitweb /
f0a7851df72738c70047141f71efd5b5e3d9c79e
[nailing-cargo.git] / t / toml-test / valid / array-table-array-string-backslash.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                'foo' => [
12                           {
13                             'bar' => '"{{baz}}"'
14                           }
15                         ]
16              };
17
18
19 my $actual = from_toml(q{foo = [ { bar="\\"{{baz}}\\""} ]
20 });
21
22 is($actual, $expected1, 'array-table-array-string-backslash - from_toml') or do{
23   diag 'EXPECTED:';
24   diag Dumper($expected1);
25
26   diag 'ACTUAL:';
27   diag Dumper($actual);
28 };
29
30 is(eval{ from_toml(to_toml($actual)) }, $actual, 'array-table-array-string-backslash - to_toml') or do{
31   diag 'INPUT:';
32   diag Dumper($actual);
33
34   diag 'TOML OUTPUT:';
35   diag to_toml($actual);
36
37   diag 'REPARSED OUTPUT:';
38   diag Dumper(from_toml(to_toml($actual)));
39 };
40
41 done_testing;