chiark / gitweb /
3370b109caed19e39a49515bb0c1ee3881063997
[nailing-cargo.git] / t / toml-test / valid / comments-at-eof2.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                'key' => 'value'
12              };
13
14
15 my $actual = from_toml(q{# This is a full-line comment
16 key = "value" # This is a comment at the end of a line});
17
18 is($actual, $expected1, 'comments-at-eof2 - 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, 'comments-at-eof2 - 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;