chiark / gitweb /
42ace11e417a1ffc4a1396a0ce592ccd6aeac12a
[nailing-cargo.git] / t / toml-test / valid / key-space.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                'a b' => bless( {
12                                  'code' => sub {
13                                                BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
14                                                use strict;
15                                                no feature ':all';
16                                                use feature ':5.16';
17                                                require Math::BigInt;
18                                                'Math::BigInt'->new('1')->beq($_);
19                                            },
20                                  '_lines' => [
21                                                6
22                                              ],
23                                  'operator' => 'CODE(...)',
24                                  'name' => '<Custom Code>',
25                                  '_file' => '(eval 412)'
26                                }, 'Test2::Compare::Custom' )
27              };
28
29
30 my $actual = from_toml(q{"a b" = 1
31 });
32
33 is($actual, $expected1, 'key-space - from_toml') or do{
34   diag 'EXPECTED:';
35   diag Dumper($expected1);
36
37   diag 'ACTUAL:';
38   diag Dumper($actual);
39 };
40
41 is(eval{ from_toml(to_toml($actual)) }, $actual, 'key-space - to_toml') or do{
42   diag 'INPUT:';
43   diag Dumper($actual);
44
45   diag 'TOML OUTPUT:';
46   diag to_toml($actual);
47
48   diag 'REPARSED OUTPUT:';
49   diag Dumper(from_toml(to_toml($actual)));
50 };
51
52 done_testing;