chiark / gitweb /
85b62e545115ba22514e144fa359b4368faec460
[nailing-cargo.git] / t / toml-test / valid / string-simple.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                'answer' => 'You are not drinking enough whisky.'
12              };
13
14
15 my $actual = from_toml(q{answer = "You are not drinking enough whisky."
16 });
17
18 is($actual, $expected1, 'string-simple - from_toml') or do{
19   diag 'EXPECTED:';
20   diag Dumper($expected1);
21
22   diag 'ACTUAL:';
23   diag Dumper($actual);
24 };
25
26 is(eval{ from_toml(to_toml($actual)) }, $actual, 'string-simple - to_toml') or do{
27   diag 'INPUT:';
28   diag Dumper($actual);
29
30   diag 'TOML OUTPUT:';
31   diag to_toml($actual);
32
33   diag 'REPARSED OUTPUT:';
34   diag Dumper(from_toml(to_toml($actual)));
35 };
36
37 done_testing;