chiark / gitweb /
Move unused dependency to test deps
[nailing-cargo.git] / t / toml-test / valid / raw-multiline-string.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                'oneline' => 'This string has a \' quote character.',
16                'multiline' => 'This string
17 has \' a quote character
18 and more than
19 one newline
20 in it.',
21                'firstnl' => 'This string has a \' quote character.'
22              };
23
24
25 my $actual = from_toml(q{oneline = '''This string has a ' quote character.'''
26 firstnl = '''
27 This string has a ' quote character.'''
28 multiline = '''
29 This string
30 has ' a quote character
31 and more than
32 one newline
33 in it.'''
34 });
35
36 is($actual, $expected1, 'raw-multiline-string - from_toml') or do{
37   diag 'EXPECTED:';
38   diag Dumper($expected1);
39
40   diag 'ACTUAL:';
41   diag Dumper($actual);
42 };
43
44 is(eval{ from_toml(to_toml($actual)) }, $actual, 'raw-multiline-string - to_toml') or do{
45   diag 'INPUT:';
46   diag Dumper($actual);
47
48   diag 'TOML OUTPUT:';
49   diag to_toml($actual);
50
51   diag 'REPARSED OUTPUT:';
52   diag Dumper(from_toml(to_toml($actual)));
53 };
54
55 done_testing;