chiark / gitweb /
Move unused dependency to test deps
[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 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                'foo' => [
16                           {
17                             'bar' => '"{{baz}}"'
18                           }
19                         ]
20              };
21
22
23 my $actual = from_toml(q{foo = [ { bar="\\"{{baz}}\\""} ]
24 });
25
26 is($actual, $expected1, 'array-table-array-string-backslash - from_toml') or do{
27   diag 'EXPECTED:';
28   diag Dumper($expected1);
29
30   diag 'ACTUAL:';
31   diag Dumper($actual);
32 };
33
34 is(eval{ from_toml(to_toml($actual)) }, $actual, 'array-table-array-string-backslash - to_toml') or do{
35   diag 'INPUT:';
36   diag Dumper($actual);
37
38   diag 'TOML OUTPUT:';
39   diag to_toml($actual);
40
41   diag 'REPARSED OUTPUT:';
42   diag Dumper(from_toml(to_toml($actual)));
43 };
44
45 done_testing;