chiark / gitweb /
80d8006a5536de51188ff0b632bf8bfa17cbb596
[nailing-cargo.git] / t / toml-test / valid / comments-at-eof.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
19 is($actual, $expected1, 'comments-at-eof - from_toml') or do{
20   diag 'EXPECTED:';
21   diag Dumper($expected1);
22
23   diag 'ACTUAL:';
24   diag Dumper($actual);
25 };
26
27 is(eval{ from_toml(to_toml($actual)) }, $actual, 'comments-at-eof - to_toml') or do{
28   diag 'INPUT:';
29   diag Dumper($actual);
30
31   diag 'TOML OUTPUT:';
32   diag to_toml($actual);
33
34   diag 'REPARSED OUTPUT:';
35   diag Dumper(from_toml(to_toml($actual)));
36 };
37
38 done_testing;