--- /dev/null
+#-------------------------------------------------------------------------------
+# Generates perl unit tests from the toml/json files in BurntSush/toml-test
+# without having to add special casing to TOML::Tiny to conform to their
+# annotated JSON format.
+#-------------------------------------------------------------------------------
+use strict;
+use warnings;
+no warnings 'experimental';
+use v5.18;
+
+use Data::Dumper;
+use JSON::PP;
+
+# We want to read unicde as characters from toml-test source files. That makes
+# things simpler for us when we parse them and generate perl source in the
+# generated test file.
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+sub slurp{
+ open my $fh, '<', $_[0] or die $!;
+ local $/;
+ <$fh>;
+}
+
+# Removes type annotations from BurntSushi/toml-test JSON files and returns the
+# cleaned up data structure to which the associated TOML file should be parsed.
+sub deturd_json{
+ state $json = JSON::PP->new->utf8(1);
+ my $annotated = $json->decode(slurp(shift));
+ my $cleanish = deannotate($annotated);
+
+ local $Data::Dumper::Varname = 'expected';
+ local $Data::Dumper::Deparse = 1;
+ return Dumper($cleanish);
+}
+
+# Recursively deannotates and inflates values from toml-test JSON data
+# structures into a format more in line with TOML::Tiny's parser outout. For
+# integer and float values, a Test2::Tools::Compare validator is generated to
+# compare using Math::Big(Int|Float)->beq, since TOML's float and int types are
+# 64 bits. Datetimes are converted to a common, normalized string format.
+sub deannotate{
+ my $data = shift;
+
+ for (ref $data) {
+ when ('HASH') {
+ if (exists $data->{type} && exists $data->{value} && keys(%$data) == 2) {
+ for ($data->{type}) {
+ return $data->{value} eq 'true' ? 1 : 0 when /bool/;
+ return [ map{ deannotate($_) } @{$data->{value}} ] when /array/;
+
+ when (/datetime/) {
+ my $src = qq{
+ use Test2::Tools::Compare qw(validator);
+ validator(sub{
+ use DateTime;
+ use DateTime::Format::RFC3339;
+ my \$exp = DateTime::Format::RFC3339->parse_datetime("$data->{value}");
+ my \$got = DateTime::Format::RFC3339->parse_datetime(\$_);
+ \$exp->set_time_zone('UTC');
+ \$got->set_time_zone('UTC');
+ return DateTime->compare(\$got, \$exp) == 0;
+ });
+ };
+
+ my $result = eval $src;
+ $@ && die $@;
+
+ return $result;
+ }
+
+ when (/integer/) {
+ my $src = qq{
+ use Test2::Tools::Compare qw(validator);
+ validator(sub{
+ require Math::BigInt;
+ Math::BigInt->new("$data->{value}")->beq(\$_);
+ });
+ };
+
+ my $result = eval $src;
+ $@ && die $@;
+
+ return $result;
+ }
+
+ when (/float/) {
+ my $src = qq{
+ use Test2::Tools::Compare qw(validator);
+ validator(sub{
+ require Math::BigFloat;
+ Math::BigFloat->new("$data->{value}")->beq(\$_);
+ });
+ };
+
+ my $result = eval $src;
+ $@ && die $@;
+
+ return $result;
+ }
+
+ default{ return $data->{value} }
+ }
+ }
+
+ my %object;
+ $object{$_} = deannotate($data->{$_}) for keys %$data;
+ return \%object;
+ }
+
+ when ('ARRAY') {
+ return [ map{ deannotate($_) } @$data ];
+ }
+
+ default{
+ return $data;
+ }
+ }
+}
+
+sub build_pospath_test_files{
+ my $src = shift;
+ my $dest = shift;
+
+ $src = "$src/tests/valid";
+ $dest = "$dest/t/toml-test/valid";
+
+ print "Generating positive path tests from $src\n";
+
+ unless (-d $dest) {
+ system('mkdir', '-p', $dest) == 0 || die $?;
+ }
+
+ my %TOML;
+ my %JSON;
+
+ opendir my $dh, $src or die $!;
+
+ while (my $file = readdir $dh) {
+ my $path = "$src/$file";
+ my ($test, $ext) = $file =~ /^(.*)\.([^\.]+)$/;
+
+ for ($ext) {
+ next unless defined;
+ $TOML{$test} = $path when /toml/;
+ $JSON{$test} = $path when /json/;
+ }
+ }
+
+ closedir $dh;
+
+ for (sort keys %TOML) {
+ my $data = deturd_json($JSON{$_});
+
+ my $toml = slurp($TOML{$_});
+ $toml =~ s/\\/\\\\/g;
+
+ open my $fh, '>', "$dest/$_.t" or die $!;
+
+ print $fh qq{# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $data
+
+my \$actual = from_toml(q{$toml});
+
+is(\$actual, \$expected1, '$_ - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper(\$expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper(\$actual);
+};
+
+is(eval{ from_toml(to_toml(\$actual)) }, \$actual, '$_ - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper(\$actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml(\$actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml(\$actual)));
+};
+
+done_testing;};
+
+ close $fh;
+ }
+}
+
+sub build_negpath_test_files{
+ my $src = shift;
+ my $dest = shift;
+
+ $src = "$src/tests/invalid";
+ $dest = "$dest/t/toml-test/invalid";
+
+ print "Generating negative path tests from $src\n";
+
+ unless (-d $dest) {
+ system('mkdir', '-p', $dest) == 0 || die $?;
+ }
+
+ my %TOML;
+
+ opendir my $dh, $src or die $!;
+
+ while (my $file = readdir $dh) {
+ my $path = "$src/$file";
+ my ($test, $ext) = $file =~ /^(.*)\.([^\.]+)$/;
+
+ if ($ext && $ext eq 'toml') {
+ $TOML{$test} = $path;
+ }
+ }
+
+ closedir $dh;
+
+ for (sort keys %TOML) {
+ my $toml = slurp($TOML{$_});
+ $toml =~ s/\\/\\\\/g;
+
+ open my $fh, '>', "$dest/$_.t" or die $!;
+
+ print $fh qq{# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+$toml
+ }, strict_arrays => 1);
+}), 'strict_mode dies on $_';
+
+done_testing;};
+
+ close $fh;
+ }
+}
+
+my $usage = "usage: build-tests \$toml-test-repo-path \$toml-tiny-repo-path\n";
+my $toml_test_path = shift @ARGV || die $usage;
+my $toml_tiny_path = shift @ARGV || die $usage;
+
+-d $toml_test_path || die "invalid path to BurntSush/toml-test: $toml_test_path\n";
+-d "$toml_test_path/tests" || die "invalid path to BurntSush/toml-test: $toml_test_path\n";
+-d $toml_tiny_path || die "invalid path to TOML::Tiny repo: $toml_tiny_path\n";
+-d "$toml_tiny_path/t" || die "invalid path to TOML::Tiny repo: $toml_tiny_path\n";
+
+build_pospath_test_files($toml_test_path, $toml_tiny_path);
+build_negpath_test_files($toml_test_path, $toml_tiny_path);
for (ref $data) {
when ('HASH') {
- for my $k (grep{ ref($data->{$_}) !~ /HASH|ARRAY/ } sort keys %$data) {
- my $key = to_toml_key($k);
- my $val = to_toml($data->{$k}, %param);
- push @buff, "$key=$val";
- }
+ if (!keys(%$data)) {
+ push @buff, '{}';
+ } else {
+ for my $k (grep{ ref($data->{$_}) !~ /HASH|ARRAY/ } sort keys %$data) {
+ my $key = to_toml_key($k);
+ my $val = to_toml($data->{$k}, %param);
+ push @buff, "$key=$val";
+ }
- for my $k (grep{ ref $data->{$_} eq 'ARRAY' } sort keys %$data) {
- my @inline;
- my @table_array;
+ for my $k (grep{ ref $data->{$_} eq 'ARRAY' } sort keys %$data) {
+ my @inline;
+ my @table_array;
- for my $v (@{$data->{$k}}) {
- if (ref $v eq 'HASH') {
- push @table_array, $v;
- } else {
- push @inline, $v;
+ for my $v (@{$data->{$k}}) {
+ if (ref $v eq 'HASH') {
+ push @table_array, $v;
+ } else {
+ push @inline, $v;
+ }
}
- }
- if (@inline) {
- my $key = to_toml_key($k);
- my $val = to_toml(\@inline, %param);
- push @buff, "$key=$val";
- }
+ if (@inline) {
+ my $key = to_toml_key($k);
+ my $val = to_toml(\@inline, %param);
+ push @buff, "$key=$val";
+ }
- if (@table_array) {
- push @KEYS, $k;
+ if (@table_array) {
+ push @KEYS, $k;
- for (@table_array) {
- push @buff, '', '[[' . join('.', map{ to_toml_key($_) } @KEYS) . ']]';
+ for (@table_array) {
+ push @buff, '', '[[' . join('.', map{ to_toml_key($_) } @KEYS) . ']]';
- for my $k (sort keys %$_) {
- my $key = to_toml_key($k);
- my $val = to_toml($_->{$k}, %param);
- push @buff, "$key=$val";
+ for my $k (sort keys %$_) {
+ my $key = to_toml_key($k);
+ my $val = to_toml($_->{$k}, %param);
+ push @buff, "$key=$val";
+ }
}
+
+ pop @KEYS;
}
+ }
+ for my $k (grep{ ref $data->{$_} eq 'HASH' } sort keys %$data) {
+ push @KEYS, $k;
+ push @buff, '', '[' . join('.', map{ to_toml_key($_) } @KEYS) . ']';
+ push @buff, to_toml($data->{$k}, %param);
pop @KEYS;
}
}
-
- for my $k (grep{ ref $data->{$_} eq 'HASH' } sort keys %$data) {
- push @KEYS, $k;
- push @buff, '', '[' . join('.', map{ to_toml_key($_) } @KEYS) . ']';
- push @buff, to_toml($data->{$k}, %param);
- pop @KEYS;
- }
}
when ('ARRAY') {
+++ /dev/null
-use Test2::V0;
-use TOML::Tiny;
-
-is from_toml('thevoid=[[[]]]'), {thevoid => [[[]]]}, 'empty';
-
-is from_toml('ints=[1,2,3]'), {ints => [1, 2, 3]}, 'no spaces';
-
-is from_toml('ints=[1, 2, 3] # comment'), {ints => [1, 2, 3]}, 'comments after array';
-
-is from_toml(q{
-
-ints=[
- 1, # comments
- 2, 3
-]
-
-}), {ints => [1, 2, 3]}, 'multi-line, w/ comments';
-
-is from_toml('ints=[1, 2, 3, ]'), {ints => [1, 2, 3]}, 'trailing comma';
-
-is from_toml('nested=[["a"], ["b", ["c"]]]'), {nested => [['a'], ['b', ['c']]]}, 'nested';
-
-is from_toml(q{
-title = [
- "Client: \"XXXX\", Job: XXXX",
- "Code: XXXX"
-]
-}), {title => ['Client: "XXXX", Job: XXXX', 'Code: XXXX']}, 'with string containing comma';;
-
-is from_toml(q{title = [ " \", ",]}), {title => [' ", ']}, 'with string containing escaped quote, then comma';
-
-is from_toml(q|foo = [ { bar="\"{{baz}}\""} ]|), {foo => [{bar => '"{{baz}}"'}]}, 'escaped quotes in string in table array table';
-
-done_testing;
+++ /dev/null
-use Test2::V0;
-use TOML::Tiny;
-
-is from_toml('x=true'), {x => $TOML::Tiny::Parser::TRUE}, 'true';
-is from_toml('x=false'), {x => $TOML::Tiny::Parser::FALSE}, 'false';
-is from_toml('x=true', inflate_boolean => sub{ $_[0] eq 'true' ? 'T' : 'F' }), {x => 'T'}, 'inflate_boolean(true)';
-is from_toml('x=false', inflate_boolean => sub{ $_[0] eq 'true' ? 'T' : 'F' }), {x => 'F'}, 'inflate_boolean(false)';
-
-done_testing;
+++ /dev/null
-use Test2::V0;
-use TOML::Tiny;
-
-is from_toml(q{
-# Top comment.
- # Top comment.
-# Top comment.
-
-# [no-extraneous-groups-please]
-
-[group] # Comment
-answer = 42 # Comment
-# no-extraneous-keys-please = 999
-# Inbetween comment.
-more = [ # Comment
- # What about multiple # comments?
- # Can you handle it?
- #
- # Evil.
-# Evil.
- 42, 42, # Comments within arrays are fun.
- # What about multiple # comments?
- # Can you handle it?
- #
- # Evil.
-# Evil.
-# ] Did I fool you?
-] # Hopefully not.
-}), {
- group => {
- answer => 42,
- more => [42, 42],
- }
-}, 'comments everywhere';
-
-is from_toml(q{
-# full line comment
-foo='bar' #comment
-}),
- {foo => 'bar'}, 'comment with eol at eof';
-
-is from_toml(q{
-# full line comment
-foo='bar' #comment}),
- {foo => 'bar'}, 'comment at eof';
-
-done_testing;
+++ /dev/null
-use Test2::V0;
-use TOML::Tiny;
-use DateTime::Format::RFC3339;
-
-my %args = (
- inflate_datetime => sub{
- my $str = shift;
- my $dt = DateTime::Format::RFC3339->parse_datetime($str);
- $dt->set_time_zone('UTC');
- ''.$dt;
- },
-);
-
-is from_toml(q{x=1987-07-05T17:45:00Z}, %args), {x => '1987-07-05T17:45:00Z'}, 'utc';
-is from_toml(q{x=1977-06-28T07:32:00-05:00}, %args), {x => '1977-06-28T12:32:00Z'}, 'offset';
-is from_toml(q{x=1977-12-21T10:32:00.555+07:00}, %args), {x => '1977-12-21T03:32:00.555000000Z'}, 'milliseconds';
-
-done_testing;
+++ /dev/null
-use Test2::V0;
-use TOML::Tiny;
-
-is from_toml(''), {}, 'empty string';
-
-done_testing;
+++ /dev/null
-use Test2::V0;
-use TOML::Tiny;
-
-is from_toml(q{x="how now brown bureaucrat"}), {x => "how now brown bureaucrat"}, 'basic string';
-is from_toml(q{x=""}), {x => ''}, 'empty string';
-is from_toml(q{x="\\\\n"}), {x => q{\n}}, 'escaped escape';
-
-is from_toml(q{backspace = "This string has a \b backspace character."}), {backspace => "This string has a \b backspace character."}, 'backspace';
-is from_toml(q{tab = "This string has a \t tab character."}), {tab => "This string has a \t tab character."}, 'tab';
-is from_toml(q{newline = "This string has a \n new line character."}), {newline => "This string has a \n new line character."}, 'newline';
-is from_toml(q{formfeed = "This string has a \f form feed character."}), {formfeed => "This string has a \f form feed character."}, 'formfeed';
-is from_toml(q{carriage = "This string has a \r carriage return character."}), {carriage => "This string has a \r carriage return character."}, 'carriage';
-is from_toml(q{quote = "This string has a \" quote character."}), {quote => "This string has a \" quote character."}, 'quote';
-is from_toml(q{backslash = "This string has a \\\\ backslash character."}), {backslash => "This string has a \\ backslash character."}, 'backslash';
-
-is from_toml(q{notunicode1 = "This string does not have a unicode \\\\u escape."}), {notunicode1 => "This string does not have a unicode \\u escape."}, 'not unicode 1';
-is from_toml(q{notunicode2 = "This string does not have a unicode \u005Cu escape."}), {notunicode2 => "This string does not have a unicode \\u escape."}, 'not unicode 2';
-is from_toml(q{notunicode3 = "This string does not have a unicode \\\\u0075 escape."}), {notunicode3 => "This string does not have a unicode \\u0075 escape."}, 'not unicode 3';
-is from_toml(q{notunicode4 = "This string does not have a unicode \\\u0075 escape."}), {notunicode4 => "This string does not have a unicode \\u0075 escape."}, 'not unicode 4';
-
-is from_toml(q{nl_mid = "val\nue"}), {nl_mid => "val\nue"}, 'newline in middle of string';
-is from_toml(q{nl_end = """value\n"""}), {nl_end => "value\n"}, 'newline at end of string';
-
-is from_toml(q{lit_nl_end = '''value\n'''}), {lit_nl_end => 'value\n'}, 'literal with \n at end';
-is from_toml(q{lit_nl_mid = 'val\nue'}), {lit_nl_mid => 'val\nue'}, 'literal with \n in middle';
-is from_toml(q{lit_nl_uni = 'val\ue'}), {lit_nl_uni => 'val\ue'}, 'literal with \u in middle';
-
-is from_toml(q{x="hash in # string"}), {x => 'hash in # string'}, 'hash inside string is not recognized as comment';
-is from_toml(q{x="hash in # string" # comment after}), {x => 'hash in # string'}, 'hash in string with comment after string parsed correctly';
-
-done_testing;
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+arrays-and-ints = [1, ["Arrays are not integers."]]
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on array-mixed-types-arrays-and-ints';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+ints-and-floats = [1, 1.1]
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on array-mixed-types-ints-and-floats';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+strings-and-ints = ["hi", 42]
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on array-mixed-types-strings-and-ints';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+no-leads = 1987-7-05T17:45:00Z
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on datetime-malformed-no-leads';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+no-secs = 1987-07-05T17:45Z
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on datetime-malformed-no-secs';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+no-t = 1987-07-0517:45:00Z
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on datetime-malformed-no-t';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+with-milli = 1987-07-5T17:45:00.12Z
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on datetime-malformed-with-milli';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+[fruit]
+type = "apple"
+
+[fruit.type]
+apple = "yes"
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on duplicate-key-table';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+dupe = false
+dupe = true
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on duplicate-keys';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+[a]
+[a]
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on duplicate-tables';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+[naughty..naughty]
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on empty-implicit-table';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+[]
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on empty-table';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+leading-zero = -03.14
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on float-leading-zero-neg';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+leading-zero = +03.14
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on float-leading-zero-pos';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+leading-zero = 03.14
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on float-leading-zero';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+answer = .12345
+neganswer = -.12345
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on float-no-leading-zero';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+answer = 1.
+neganswer = -1.
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on float-no-trailing-digits';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+bad = 1._2
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on float-underscore-after-point';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+bad = 1.2_
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on float-underscore-after';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+bad = 1_.2
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on float-underscore-before-point';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+bad = _1.2
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on float-underscore-before';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+simple = { a = 1
+}
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on inline-table-linebreak';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+leading-zero = -012
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on integer-leading-zero-neg';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+leading-zero = +012
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on integer-leading-zero-pos';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+leading-zero = 012
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on integer-leading-zero';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+bad = 123_
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on integer-underscore-after';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+bad = _123
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on integer-underscore-before';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+bad = 1__23
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on integer-underscore-double';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+[[agencies]] owner = "S Cjelli"
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on key-after-array';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+[error] this = "should not be here"
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on key-after-table';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+ = 1
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on key-empty';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+a# = 1
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on key-hash';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+a
+= 1
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on key-newline';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+a = 1 b = 2
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on key-no-eol';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+[abc = 1
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on key-open-bracket';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+[
+ }, strict_arrays => 1);
+}), 'strict_mode dies on key-single-open-bracket';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+a b = 1
+ }, strict_arrays => 1);
+}), 'strict_mode dies on key-space';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+[a]
+[xyz = 5
+[b]
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on key-start-bracket';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+key= = 1
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on key-two-equals';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+[ [table]]
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on llbrace';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+json_like = {
+ first = "Tom",
+ last = "Preston-Werner"
+}
+ }, strict_arrays => 1);
+}), 'strict_mode dies on multi-line-inline-table';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+[[table] ]
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on rrbrace';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+naughty = "\\xAg"
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on string-bad-byte-escape';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+invalid-codepoint = "This string contains a non scalar unicode codepoint \\uD801"
+ }, strict_arrays => 1);
+}), 'strict_mode dies on string-bad-codepoint';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+invalid-escape = "This string has a bad \\a escape character."
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on string-bad-escape';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+invalid-escape = "This string has a bad \\/ escape character."
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on string-bad-slash-escape';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+str = "val\\ue"
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on string-bad-uni-esc';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+answer = "\\x33"
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on string-byte-escapes';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+no-ending-quote = "One time, at band camp
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on string-no-close';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+# This test is a bit tricky. It should fail because the first use of
+# `[[albums.songs]]` without first declaring `albums` implies that `albums`
+# must be a table. The alternative would be quite weird. Namely, it wouldn't
+# comply with the TOML spec: "Each double-bracketed sub-table will belong to
+# the most *recently* defined table element *above* it."
+#
+# This is in contrast to the *valid* test, table-array-implicit where
+# `[[albums.songs]]` works by itself, so long as `[[albums]]` isn't declared
+# later. (Although, `[albums]` could be.)
+[[albums.songs]]
+name = "Glory Days"
+
+[[albums]]
+name = "Born in the USA"
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on table-array-implicit';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+[[albums]
+name = "Born to Run"
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on table-array-malformed-bracket';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+[[]]
+name = "Born to Run"
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on table-array-malformed-empty';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+[]
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on table-empty';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+[a]b]
+zyx = 42
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on table-nested-brackets-close';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+[a[b]
+zyx = 42
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on table-nested-brackets-open';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+[invalid key]
+ }, strict_arrays => 1);
+}), 'strict_mode dies on table-whitespace';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+[key#group]
+answer = 42
+ }, strict_arrays => 1);
+}), 'strict_mode dies on table-with-pound';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+array = [
+ "Is there life after an array separator?", No
+ "Entry"
+]
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on text-after-array-entries';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+answer = 42 the ultimate answer?
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on text-after-integer';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+string = "Is there life after strings?" No.
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on text-after-string';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+[error] this shouldn't be here
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on text-after-table';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+array = [
+ "Is there life before an array separator?" No,
+ "Entry"
+]
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on text-before-array-separator';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+ok dies(sub{
+ from_toml(q{
+array = [
+ "Entry 1",
+ I don't belong,
+ "Entry 2",
+]
+
+ }, strict_arrays => 1);
+}), 'strict_mode dies on text-in-array';
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'thevoid' => [
+ [
+ [
+ [
+ []
+ ]
+ ]
+ ]
+ ]
+ };
+
+
+my $actual = from_toml(q{thevoid = [[[[[]]]]]
+});
+
+is($actual, $expected1, 'array-empty - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'array-empty - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'ints' => [
+ bless( {
+ '_file' => '(eval 47)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('1')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>'
+ }, 'Test2::Compare::Custom' ),
+ bless( {
+ '_file' => '(eval 112)',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('2')->beq($_);
+ },
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>'
+ }, 'Test2::Compare::Custom' ),
+ bless( {
+ '_file' => '(eval 113)',
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('3')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ]
+ }, 'Test2::Compare::Custom' )
+ ]
+ };
+
+
+my $actual = from_toml(q{ints = [1,2,3]
+});
+
+is($actual, $expected1, 'array-nospaces - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'array-nospaces - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'title' => [
+ ' ", '
+ ]
+ };
+
+
+my $actual = from_toml(q{title = [ " \\", ",]
+});
+
+is($actual, $expected1, 'array-string-quote-comma-2 - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'array-string-quote-comma-2 - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'title' => [
+ 'Client: "XXXX", Job: XXXX',
+ 'Code: XXXX'
+ ]
+ };
+
+
+my $actual = from_toml(q{title = [
+"Client: \\"XXXX\\", Job: XXXX",
+"Code: XXXX"
+]
+});
+
+is($actual, $expected1, 'array-string-quote-comma - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'array-string-quote-comma - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'title' => [
+ 'Client: XXXX, Job: XXXX',
+ 'Code: XXXX'
+ ]
+ };
+
+
+my $actual = from_toml(q{title = [
+"Client: XXXX, Job: XXXX",
+"Code: XXXX"
+]
+});
+
+is($actual, $expected1, 'array-string-with-comma - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'array-string-with-comma - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'foo' => [
+ {
+ 'bar' => '"{{baz}}"'
+ }
+ ]
+ };
+
+
+my $actual = from_toml(q{foo = [ { bar="\\"{{baz}}\\""} ]
+});
+
+is($actual, $expected1, 'array-table-array-string-backslash - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'array-table-array-string-backslash - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'mixed' => [
+ [
+ bless( {
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('1')->beq($_);
+ },
+ '_file' => '(eval 362)'
+ }, 'Test2::Compare::Custom' ),
+ bless( {
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('2')->beq($_);
+ },
+ '_file' => '(eval 363)'
+ }, 'Test2::Compare::Custom' )
+ ],
+ [
+ 'a',
+ 'b'
+ ],
+ [
+ bless( {
+ '_file' => '(eval 364)',
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('1.1')->beq($_);
+ }
+ }, 'Test2::Compare::Custom' ),
+ bless( {
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('2.1')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ '_file' => '(eval 365)'
+ }, 'Test2::Compare::Custom' )
+ ]
+ ]
+ };
+
+
+my $actual = from_toml(q{mixed = [[1, 2], ["a", "b"], [1.1, 2.1]]
+});
+
+is($actual, $expected1, 'arrays-hetergeneous - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'arrays-hetergeneous - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'nest' => [
+ [
+ 'a'
+ ],
+ [
+ 'b'
+ ]
+ ]
+ };
+
+
+my $actual = from_toml(q{nest = [["a"], ["b"]]
+});
+
+is($actual, $expected1, 'arrays-nested - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'arrays-nested - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'dates' => [
+ bless( {
+ '_file' => '(eval 139)',
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ '_lines' => [
+ 11
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ my $exp = 'DateTime::Format::RFC3339'->parse_datetime('1987-07-05T17:45:00Z');
+ my $got = 'DateTime::Format::RFC3339'->parse_datetime($_);
+ $exp->set_time_zone('UTC');
+ $got->set_time_zone('UTC');
+ return 'DateTime'->compare($got, $exp) == 0;
+ }
+ }, 'Test2::Compare::Custom' ),
+ bless( {
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ my $exp = 'DateTime::Format::RFC3339'->parse_datetime('1979-05-27T07:32:00Z');
+ my $got = 'DateTime::Format::RFC3339'->parse_datetime($_);
+ $exp->set_time_zone('UTC');
+ $got->set_time_zone('UTC');
+ return 'DateTime'->compare($got, $exp) == 0;
+ },
+ '_lines' => [
+ 11
+ ],
+ '_file' => '(eval 360)'
+ }, 'Test2::Compare::Custom' ),
+ bless( {
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ my $exp = 'DateTime::Format::RFC3339'->parse_datetime('2006-06-01T11:00:00Z');
+ my $got = 'DateTime::Format::RFC3339'->parse_datetime($_);
+ $exp->set_time_zone('UTC');
+ $got->set_time_zone('UTC');
+ return 'DateTime'->compare($got, $exp) == 0;
+ },
+ '_lines' => [
+ 11
+ ],
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ '_file' => '(eval 361)'
+ }, 'Test2::Compare::Custom' )
+ ],
+ 'floats' => [
+ bless( {
+ '_file' => '(eval 136)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('1.1')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>'
+ }, 'Test2::Compare::Custom' ),
+ bless( {
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('2.1')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ '_file' => '(eval 137)'
+ }, 'Test2::Compare::Custom' ),
+ bless( {
+ '_file' => '(eval 138)',
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('3.1')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ]
+ }, 'Test2::Compare::Custom' )
+ ],
+ 'strings' => [
+ 'a',
+ 'b',
+ 'c'
+ ],
+ 'comments' => [
+ bless( {
+ '_file' => '(eval 134)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('1')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)'
+ }, 'Test2::Compare::Custom' ),
+ bless( {
+ '_file' => '(eval 135)',
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('2')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ]
+ }, 'Test2::Compare::Custom' )
+ ],
+ 'ints' => [
+ bless( {
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('1')->beq($_);
+ },
+ '_file' => '(eval 131)'
+ }, 'Test2::Compare::Custom' ),
+ bless( {
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('2')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ '_file' => '(eval 132)'
+ }, 'Test2::Compare::Custom' ),
+ bless( {
+ '_file' => '(eval 133)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('3')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)'
+ }, 'Test2::Compare::Custom' )
+ ]
+ };
+
+
+my $actual = from_toml(q{ints = [1, 2, 3]
+floats = [1.1, 2.1, 3.1]
+strings = ["a", "b", "c"]
+dates = [
+ 1987-07-05T17:45:00Z,
+ 1979-05-27T07:32:00Z,
+ 2006-06-01T11:00:00Z,
+]
+comments = [
+ 1,
+ 2, #this is ok
+]
+});
+
+is($actual, $expected1, 'arrays - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'arrays - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'f' => 0,
+ 't' => 1
+ };
+
+
+my $actual = from_toml(q{t = true
+f = false
+});
+
+is($actual, $expected1, 'bool - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'bool - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'key' => 'value'
+ };
+
+
+my $actual = from_toml(q{# This is a full-line comment
+key = "value" # This is a comment at the end of a line
+});
+
+is($actual, $expected1, 'comments-at-eof - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'comments-at-eof - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'key' => 'value'
+ };
+
+
+my $actual = from_toml(q{# This is a full-line comment
+key = "value" # This is a comment at the end of a line});
+
+is($actual, $expected1, 'comments-at-eof2 - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'comments-at-eof2 - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'group' => {
+ 'answer' => bless( {
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('42')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ '_file' => '(eval 366)'
+ }, 'Test2::Compare::Custom' ),
+ 'more' => [
+ bless( {
+ '_file' => '(eval 367)',
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('42')->beq($_);
+ }
+ }, 'Test2::Compare::Custom' ),
+ bless( {
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('42')->beq($_);
+ },
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ '_file' => '(eval 368)'
+ }, 'Test2::Compare::Custom' )
+ ]
+ }
+ };
+
+
+my $actual = from_toml(q{# Top comment.
+ # Top comment.
+# Top comment.
+
+# [no-extraneous-groups-please]
+
+[group] # Comment
+answer = 42 # Comment
+# no-extraneous-keys-please = 999
+# Inbetween comment.
+more = [ # Comment
+ # What about multiple # comments?
+ # Can you handle it?
+ #
+ # Evil.
+# Evil.
+ 42, 42, # Comments within arrays are fun.
+ # What about multiple # comments?
+ # Can you handle it?
+ #
+ # Evil.
+# Evil.
+# ] Did I fool you?
+] # Hopefully not.
+});
+
+is($actual, $expected1, 'comments-everywhere - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'comments-everywhere - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'bestdayever' => bless( {
+ '_lines' => [
+ 11
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ my $exp = 'DateTime::Format::RFC3339'->parse_datetime('2017-06-06T12:34:56-05:00');
+ my $got = 'DateTime::Format::RFC3339'->parse_datetime($_);
+ $exp->set_time_zone('UTC');
+ $got->set_time_zone('UTC');
+ return 'DateTime'->compare($got, $exp) == 0;
+ },
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ '_file' => '(eval 372)'
+ }, 'Test2::Compare::Custom' )
+ };
+
+
+my $actual = from_toml(q{bestdayever = 2017-06-06T12:34:56-05:00
+});
+
+is($actual, $expected1, 'datetime-timezone - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'datetime-timezone - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'milliseconds' => bless( {
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ '_lines' => [
+ 11
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ my $exp = 'DateTime::Format::RFC3339'->parse_datetime('1977-12-21T03:32:00.555+00:00');
+ my $got = 'DateTime::Format::RFC3339'->parse_datetime($_);
+ $exp->set_time_zone('UTC');
+ $got->set_time_zone('UTC');
+ return 'DateTime'->compare($got, $exp) == 0;
+ },
+ '_file' => '(eval 369)'
+ }, 'Test2::Compare::Custom' ),
+ 'numoffset' => bless( {
+ '_file' => '(eval 370)',
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ '_lines' => [
+ 11
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ my $exp = 'DateTime::Format::RFC3339'->parse_datetime('1977-06-28T12:32:00Z');
+ my $got = 'DateTime::Format::RFC3339'->parse_datetime($_);
+ $exp->set_time_zone('UTC');
+ $got->set_time_zone('UTC');
+ return 'DateTime'->compare($got, $exp) == 0;
+ }
+ }, 'Test2::Compare::Custom' ),
+ 'bestdayever' => bless( {
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ '_lines' => [
+ 11
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ my $exp = 'DateTime::Format::RFC3339'->parse_datetime('1987-07-05T17:45:00Z');
+ my $got = 'DateTime::Format::RFC3339'->parse_datetime($_);
+ $exp->set_time_zone('UTC');
+ $got->set_time_zone('UTC');
+ return 'DateTime'->compare($got, $exp) == 0;
+ },
+ '_file' => '(eval 371)'
+ }, 'Test2::Compare::Custom' )
+ };
+
+
+my $actual = from_toml(q{bestdayever = 1987-07-05T17:45:00Z
+numoffset = 1977-06-28T07:32:00-05:00
+milliseconds = 1977-12-21T10:32:00.555+07:00
+});
+
+is($actual, $expected1, 'datetime - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'datetime - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'test' => '"one"'
+ };
+
+
+my $actual = from_toml(q{test = "\\"one\\""
+});
+
+is($actual, $expected1, 'double-quote-escape - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'double-quote-escape - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {};
+
+
+my $actual = from_toml(q{});
+
+is($actual, $expected1, 'empty - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'empty - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'answer' => '\\x64'
+ };
+
+
+my $actual = from_toml(q{answer = "\\\\x64"
+});
+
+is($actual, $expected1, 'escaped-escape - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'escaped-escape - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'numtheory' => {
+ 'boring' => 0,
+ 'perfection' => [
+ bless( {
+ '_file' => '(eval 373)',
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('6')->beq($_);
+ }
+ }, 'Test2::Compare::Custom' ),
+ bless( {
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('28')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ '_file' => '(eval 374)'
+ }, 'Test2::Compare::Custom' ),
+ bless( {
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('496')->beq($_);
+ },
+ '_file' => '(eval 375)'
+ }, 'Test2::Compare::Custom' )
+ ]
+ },
+ 'best-day-ever' => bless( {
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ my $exp = 'DateTime::Format::RFC3339'->parse_datetime('1987-07-05T17:45:00Z');
+ my $got = 'DateTime::Format::RFC3339'->parse_datetime($_);
+ $exp->set_time_zone('UTC');
+ $got->set_time_zone('UTC');
+ return 'DateTime'->compare($got, $exp) == 0;
+ },
+ '_lines' => [
+ 11
+ ],
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ '_file' => '(eval 376)'
+ }, 'Test2::Compare::Custom' )
+ };
+
+
+my $actual = from_toml(q{best-day-ever = 1987-07-05T17:45:00Z
+
+[numtheory]
+boring = false
+perfection = [6, 28, 496]
+});
+
+is($actual, $expected1, 'example - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'example - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'million' => bless( {
+ '_file' => '(eval 377)',
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('1000000')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ]
+ }, 'Test2::Compare::Custom' ),
+ 'minustenth' => bless( {
+ '_file' => '(eval 378)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('-0.1')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>'
+ }, 'Test2::Compare::Custom' ),
+ 'beast' => bless( {
+ '_file' => '(eval 379)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('666')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)'
+ }, 'Test2::Compare::Custom' )
+ };
+
+
+my $actual = from_toml(q{million = 1e6
+minustenth = -1E-1
+beast = 6.66E2
+});
+
+is($actual, $expected1, 'exponent-part-float - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'exponent-part-float - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'pointlower' => bless( {
+ '_file' => '(eval 387)',
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('310.0')->beq($_);
+ }
+ }, 'Test2::Compare::Custom' ),
+ 'pointupper' => bless( {
+ '_file' => '(eval 388)',
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('310.0')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ]
+ }, 'Test2::Compare::Custom' ),
+ 'pos' => bless( {
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('300.0')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ '_file' => '(eval 389)'
+ }, 'Test2::Compare::Custom' ),
+ 'zero' => bless( {
+ '_file' => '(eval 390)',
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('3.0')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ]
+ }, 'Test2::Compare::Custom' ),
+ 'upper' => bless( {
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('300.0')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ '_file' => '(eval 385)'
+ }, 'Test2::Compare::Custom' ),
+ 'lower' => bless( {
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('300.0')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ '_file' => '(eval 384)'
+ }, 'Test2::Compare::Custom' ),
+ 'neg' => bless( {
+ '_file' => '(eval 386)',
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('0.03')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ]
+ }, 'Test2::Compare::Custom' )
+ };
+
+
+my $actual = from_toml(q{lower = 3e2
+upper = 3E2
+neg = 3e-2
+pos = 3E+2
+zero = 3e0
+pointlower = 3.1e2
+pointupper = 3.1E2
+});
+
+is($actual, $expected1, 'float-exponent - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'float-exponent - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'before' => bless( {
+ '_file' => '(eval 393)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('3141.5927')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)'
+ }, 'Test2::Compare::Custom' ),
+ 'after' => bless( {
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('3141.5927')->beq($_);
+ },
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ '_file' => '(eval 392)'
+ }, 'Test2::Compare::Custom' ),
+ 'exponent' => bless( {
+ '_file' => '(eval 391)',
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('3e14')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ]
+ }, 'Test2::Compare::Custom' )
+ };
+
+
+my $actual = from_toml(q{before = 3_141.5927
+after = 3141.592_7
+exponent = 3e1_4
+});
+
+is($actual, $expected1, 'float-underscore - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'float-underscore - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'pi' => bless( {
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('3.14')->beq($_);
+ },
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ '_file' => '(eval 381)'
+ }, 'Test2::Compare::Custom' ),
+ 'zero-intpart' => bless( {
+ '_file' => '(eval 380)',
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('0.123')->beq($_);
+ }
+ }, 'Test2::Compare::Custom' ),
+ 'pospi' => bless( {
+ '_file' => '(eval 383)',
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('3.14')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ]
+ }, 'Test2::Compare::Custom' ),
+ 'negpi' => bless( {
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('-3.14')->beq($_);
+ },
+ '_file' => '(eval 382)'
+ }, 'Test2::Compare::Custom' )
+ };
+
+
+my $actual = from_toml(q{pi = 3.14
+pospi = +3.14
+negpi = -3.14
+zero-intpart = 0.123
+});
+
+is($actual, $expected1, 'float - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'float - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'a' => {
+ 'b' => {
+ 'c' => {
+ 'answer' => bless( {
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('42')->beq($_);
+ },
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ '_file' => '(eval 395)'
+ }, 'Test2::Compare::Custom' )
+ }
+ },
+ 'better' => bless( {
+ '_file' => '(eval 394)',
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('43')->beq($_);
+ }
+ }, 'Test2::Compare::Custom' )
+ }
+ };
+
+
+my $actual = from_toml(q{[a.b.c]
+answer = 42
+
+[a]
+better = 43
+});
+
+is($actual, $expected1, 'implicit-and-explicit-after - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'implicit-and-explicit-after - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'a' => {
+ 'b' => {
+ 'c' => {
+ 'answer' => bless( {
+ '_file' => '(eval 396)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('42')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>'
+ }, 'Test2::Compare::Custom' )
+ }
+ },
+ 'better' => bless( {
+ '_file' => '(eval 397)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('43')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>'
+ }, 'Test2::Compare::Custom' )
+ }
+ };
+
+
+my $actual = from_toml(q{[a]
+better = 43
+
+[a.b.c]
+answer = 42
+});
+
+is($actual, $expected1, 'implicit-and-explicit-before - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'implicit-and-explicit-before - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'a' => {
+ 'b' => {
+ 'c' => {
+ 'answer' => bless( {
+ '_file' => '(eval 398)',
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('42')->beq($_);
+ }
+ }, 'Test2::Compare::Custom' )
+ }
+ }
+ }
+ };
+
+
+my $actual = from_toml(q{[a.b.c]
+answer = 42
+});
+
+is($actual, $expected1, 'implicit-groups - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'implicit-groups - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'people' => [
+ {
+ 'last_name' => 'Springsteen',
+ 'first_name' => 'Bruce'
+ },
+ {
+ 'last_name' => 'Clapton',
+ 'first_name' => 'Eric'
+ },
+ {
+ 'last_name' => 'Seger',
+ 'first_name' => 'Bob'
+ }
+ ]
+ };
+
+
+my $actual = from_toml(q{people = [{first_name = "Bruce", last_name = "Springsteen"},
+ {first_name = "Eric", last_name = "Clapton"},
+ {first_name = "Bob", last_name = "Seger"}]
+});
+
+is($actual, $expected1, 'inline-table-array - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'inline-table-array - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'name' => {
+ 'first' => 'Tom',
+ 'last' => 'Preston-Werner'
+ },
+ 'point' => {
+ 'y' => bless( {
+ '_file' => '(eval 399)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('2')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>'
+ }, 'Test2::Compare::Custom' ),
+ 'x' => bless( {
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('1')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ '_file' => '(eval 400)'
+ }, 'Test2::Compare::Custom' )
+ },
+ 'simple' => {
+ 'a' => bless( {
+ '_file' => '(eval 401)',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('1')->beq($_);
+ },
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>'
+ }, 'Test2::Compare::Custom' )
+ },
+ 'str-key' => {
+ 'a' => bless( {
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('1')->beq($_);
+ },
+ '_file' => '(eval 404)'
+ }, 'Test2::Compare::Custom' )
+ },
+ 'table-array' => [
+ {
+ 'a' => bless( {
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('1')->beq($_);
+ },
+ '_file' => '(eval 402)'
+ }, 'Test2::Compare::Custom' )
+ },
+ {
+ 'b' => bless( {
+ '_file' => '(eval 403)',
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('2')->beq($_);
+ }
+ }, 'Test2::Compare::Custom' )
+ }
+ ]
+ };
+
+
+my $actual = from_toml(q{name = { first = "Tom", last = "Preston-Werner" }
+point = { x = 1, y = 2 }
+simple = { a = 1 }
+str-key = { "a" = 1 }
+table-array = [{ "a" = 1 }, { "b" = 2 }]
+});
+
+is($actual, $expected1, 'inline-table - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'inline-table - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'kilo' => bless( {
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('1000')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ '_file' => '(eval 409)'
+ }, 'Test2::Compare::Custom' )
+ };
+
+
+my $actual = from_toml(q{kilo = 1_000
+});
+
+is($actual, $expected1, 'integer-underscore - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'integer-underscore - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'zero' => bless( {
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('0')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ '_file' => '(eval 406)'
+ }, 'Test2::Compare::Custom' ),
+ 'neganswer' => bless( {
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('-42')->beq($_);
+ },
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ '_file' => '(eval 407)'
+ }, 'Test2::Compare::Custom' ),
+ 'posanswer' => bless( {
+ '_file' => '(eval 405)',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('42')->beq($_);
+ },
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)'
+ }, 'Test2::Compare::Custom' ),
+ 'answer' => bless( {
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('42')->beq($_);
+ },
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ '_file' => '(eval 408)'
+ }, 'Test2::Compare::Custom' )
+ };
+
+
+my $actual = from_toml(q{answer = 42
+posanswer = +42
+neganswer = -42
+zero = 0
+});
+
+is($actual, $expected1, 'integer - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'integer - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'answer' => bless( {
+ '_file' => '(eval 410)',
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('42')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ]
+ }, 'Test2::Compare::Custom' )
+ };
+
+
+my $actual = from_toml(q{answer=42
+});
+
+is($actual, $expected1, 'key-equals-nospace - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'key-equals-nospace - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ '1' => bless( {
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('1')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ '_file' => '(eval 411)'
+ }, 'Test2::Compare::Custom' )
+ };
+
+
+my $actual = from_toml(q{1 = 1
+});
+
+is($actual, $expected1, 'key-numeric - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'key-numeric - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'a b' => bless( {
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('1')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ '_file' => '(eval 412)'
+ }, 'Test2::Compare::Custom' )
+ };
+
+
+my $actual = from_toml(q{"a b" = 1
+});
+
+is($actual, $expected1, 'key-space - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'key-space - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ '~!@$^&*()_+-`1234567890[]|/?><.,;:\'' => bless( {
+ '_file' => '(eval 413)',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('1')->beq($_);
+ },
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>'
+ }, 'Test2::Compare::Custom' )
+ };
+
+
+my $actual = from_toml(q{"~!@$^&*()_+-`1234567890[]|/?><.,;:'" = 1
+});
+
+is($actual, $expected1, 'key-special-chars - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'key-special-chars - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'plain_table' => {
+ 'with.dot' => bless( {
+ '_file' => '(eval 415)',
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('4')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ]
+ }, 'Test2::Compare::Custom' ),
+ 'plain' => bless( {
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('3')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ '_file' => '(eval 414)'
+ }, 'Test2::Compare::Custom' )
+ },
+ 'table' => {
+ 'withdot' => {
+ 'plain' => bless( {
+ '_file' => '(eval 416)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('5')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>'
+ }, 'Test2::Compare::Custom' ),
+ 'key.with.dots' => bless( {
+ '_file' => '(eval 417)',
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('6')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ]
+ }, 'Test2::Compare::Custom' )
+ }
+ },
+ 'plain' => bless( {
+ '_file' => '(eval 418)',
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('1')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ]
+ }, 'Test2::Compare::Custom' ),
+ 'with.dot' => bless( {
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('2')->beq($_);
+ },
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ '_file' => '(eval 419)'
+ }, 'Test2::Compare::Custom' )
+ };
+
+
+my $actual = from_toml(q{plain = 1
+"with.dot" = 2
+
+[plain_table]
+plain = 3
+"with.dot" = 4
+
+[table.withdot]
+plain = 5
+"key.with.dots" = 6});
+
+is($actual, $expected1, 'keys-with-dots - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'keys-with-dots - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'neglongpi' => bless( {
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('-3.141592653589793')->beq($_);
+ },
+ '_file' => '(eval 420)'
+ }, 'Test2::Compare::Custom' ),
+ 'longpi' => bless( {
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('3.141592653589793')->beq($_);
+ },
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ '_file' => '(eval 421)'
+ }, 'Test2::Compare::Custom' )
+ };
+
+
+my $actual = from_toml(q{longpi = 3.141592653589793
+neglongpi = -3.141592653589793
+});
+
+is($actual, $expected1, 'long-float - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'long-float - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'neganswer' => bless( {
+ '_file' => '(eval 423)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('-9223372036854775808')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>'
+ }, 'Test2::Compare::Custom' ),
+ 'answer' => bless( {
+ '_file' => '(eval 422)',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('9223372036854775807')->beq($_);
+ },
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)'
+ }, 'Test2::Compare::Custom' )
+ };
+
+
+my $actual = from_toml(q{answer = 9223372036854775807
+neganswer = -9223372036854775808
+});
+
+is($actual, $expected1, 'long-integer - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'long-integer - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'equivalent_three' => 'The quick brown fox jumps over the lazy dog.',
+ 'equivalent_one' => 'The quick brown fox jumps over the lazy dog.',
+ 'equivalent_two' => 'The quick brown fox jumps over the lazy dog.',
+ 'multiline_empty_four' => '',
+ 'multiline_empty_one' => '',
+ 'multiline_empty_two' => '',
+ 'multiline_empty_three' => ''
+ };
+
+
+my $actual = from_toml(q{multiline_empty_one = """"""
+multiline_empty_two = """
+"""
+multiline_empty_three = """\\
+ """
+multiline_empty_four = """\\
+ \\
+ \\
+ """
+
+equivalent_one = "The quick brown fox jumps over the lazy dog."
+equivalent_two = """
+The quick brown \\
+
+
+ fox jumps over \\
+ the lazy dog."""
+
+equivalent_three = """\\
+ The quick brown \\
+ fox jumps over \\
+ the lazy dog.\\
+ """
+});
+
+is($actual, $expected1, 'multiline-string - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'multiline-string - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'a' => [
+ {
+ 'b' => {}
+ }
+ ]
+ };
+
+
+my $actual = from_toml(q{a = [ { b = {} } ]
+});
+
+is($actual, $expected1, 'nested-inline-table-array - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'nested-inline-table-array - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'newline' => 'crlf',
+ 'os' => 'DOS'
+ };
+
+
+my $actual = from_toml(q{os = "DOS"\r
+newline = "crlf"\r
+});
+
+is($actual, $expected1, 'newline-crlf - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'newline-crlf - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'os' => 'unix',
+ 'newline' => 'lf'
+ };
+
+
+my $actual = from_toml(q{os = "unix"
+newline = "lf"
+});
+
+is($actual, $expected1, 'newline-lf - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'newline-lf - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'multiline' => 'This string
+has \' a quote character
+and more than
+one newline
+in it.',
+ 'firstnl' => 'This string has a \' quote character.',
+ 'oneline' => 'This string has a \' quote character.'
+ };
+
+
+my $actual = from_toml(q{oneline = '''This string has a ' quote character.'''
+firstnl = '''
+This string has a ' quote character.'''
+multiline = '''
+This string
+has ' a quote character
+and more than
+one newline
+in it.'''
+});
+
+is($actual, $expected1, 'raw-multiline-string - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'raw-multiline-string - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'formfeed' => 'This string has a \\f form feed character.',
+ 'slash' => 'This string has a \\/ slash character.',
+ 'carriage' => 'This string has a \\r carriage return character.',
+ 'tab' => 'This string has a \\t tab character.',
+ 'backspace' => 'This string has a \\b backspace character.',
+ 'newline' => 'This string has a \\n new line character.',
+ 'backslash' => 'This string has a \\\\ backslash character.'
+ };
+
+
+my $actual = from_toml(q{backspace = 'This string has a \\b backspace character.'
+tab = 'This string has a \\t tab character.'
+newline = 'This string has a \\n new line character.'
+formfeed = 'This string has a \\f form feed character.'
+carriage = 'This string has a \\r carriage return character.'
+slash = 'This string has a \\/ slash character.'
+backslash = 'This string has a \\\\ backslash character.'
+});
+
+is($actual, $expected1, 'raw-string - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'raw-string - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'black' => {
+ 'python' => '>3.6',
+ 'allow_prereleases' => 1,
+ 'version' => '>=18.9b0'
+ }
+ };
+
+
+my $actual = from_toml(q{black = { python=">3.6", version=">=18.9b0", allow_prereleases=true }
+});
+
+is($actual, $expected1, 'right-curly-brace-after-boolean - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'right-curly-brace-after-boolean - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'answer' => ''
+ };
+
+
+my $actual = from_toml(q{answer = ""
+});
+
+is($actual, $expected1, 'string-empty - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'string-empty - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'notunicode1' => 'This string does not have a unicode \\u escape.',
+ 'notunicode4' => 'This string does not have a unicode \\u escape.',
+ 'newline' => 'This string has a
+ new line character.',
+ 'tab' => 'This string has a tab character.',
+ 'carriage' => 'This string has a \r carriage return character.',
+ 'backspace' => 'This string has a \b backspace character.',
+ 'formfeed' => 'This string has a \f form feed character.',
+ 'backslash' => 'This string has a \\ backslash character.',
+ 'quote' => 'This string has a " quote character.',
+ 'notunicode2' => 'This string does not have a unicode \\u escape.',
+ 'notunicode3' => 'This string does not have a unicode \\u0075 escape.'
+ };
+
+
+my $actual = from_toml(q{backspace = "This string has a \\b backspace character."
+tab = "This string has a \\t tab character."
+newline = "This string has a \\n new line character."
+formfeed = "This string has a \\f form feed character."
+carriage = "This string has a \\r carriage return character."
+quote = "This string has a \\" quote character."
+backslash = "This string has a \\\\ backslash character."
+notunicode1 = "This string does not have a unicode \\\\u escape."
+notunicode2 = "This string does not have a unicode \\u005Cu escape."
+notunicode3 = "This string does not have a unicode \\\\u0075 escape."
+notunicode4 = "This string does not have a unicode \\\\\\u0075 escape."
+});
+
+is($actual, $expected1, 'string-escapes - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'string-escapes - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'lit_nl_end' => 'value\\n',
+ 'lit_nl_uni' => 'val\\ue',
+ 'lit_nl_mid' => 'val\\nue',
+ 'nl_mid' => 'val
+ue',
+ 'nl_end' => 'value
+'
+ };
+
+
+my $actual = from_toml(q{nl_mid = "val\\nue"
+nl_end = """value\\n"""
+
+lit_nl_end = '''value\\n'''
+lit_nl_mid = 'val\\nue'
+lit_nl_uni = 'val\\ue'
+});
+
+is($actual, $expected1, 'string-nl - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'string-nl - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'answer' => 'You are not drinking enough whisky.'
+ };
+
+
+my $actual = from_toml(q{answer = "You are not drinking enough whisky."
+});
+
+is($actual, $expected1, 'string-simple - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'string-simple - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'poundcomment' => 'But there are # some comments here.',
+ 'pound' => 'We see no # comments here.'
+ };
+
+
+my $actual = from_toml(q{pound = "We see no # comments here."
+poundcomment = "But there are # some comments here." # Did I # mess you up?
+});
+
+is($actual, $expected1, 'string-with-pound - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'string-with-pound - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'albums' => {
+ 'songs' => [
+ {
+ 'name' => 'Glory Days'
+ }
+ ]
+ }
+ };
+
+
+my $actual = from_toml(q{[[albums.songs]]
+name = "Glory Days"
+});
+
+is($actual, $expected1, 'table-array-implicit - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'table-array-implicit - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'people' => [
+ {
+ 'first_name' => 'Bruce',
+ 'last_name' => 'Springsteen'
+ },
+ {
+ 'first_name' => 'Eric',
+ 'last_name' => 'Clapton'
+ },
+ {
+ 'last_name' => 'Seger',
+ 'first_name' => 'Bob'
+ }
+ ]
+ };
+
+
+my $actual = from_toml(q{[[people]]
+first_name = "Bruce"
+last_name = "Springsteen"
+
+[[people]]
+first_name = "Eric"
+last_name = "Clapton"
+
+[[people]]
+first_name = "Bob"
+last_name = "Seger"
+});
+
+is($actual, $expected1, 'table-array-many - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'table-array-many - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'albums' => [
+ {
+ 'name' => 'Born to Run',
+ 'songs' => [
+ {
+ 'name' => 'Jungleland'
+ },
+ {
+ 'name' => 'Meeting Across the River'
+ }
+ ]
+ },
+ {
+ 'songs' => [
+ {
+ 'name' => 'Glory Days'
+ },
+ {
+ 'name' => 'Dancing in the Dark'
+ }
+ ],
+ 'name' => 'Born in the USA'
+ }
+ ]
+ };
+
+
+my $actual = from_toml(q{[[albums]]
+name = "Born to Run"
+
+ [[albums.songs]]
+ name = "Jungleland"
+
+ [[albums.songs]]
+ name = "Meeting Across the River"
+
+[[albums]]
+name = "Born in the USA"
+
+ [[albums.songs]]
+ name = "Glory Days"
+
+ [[albums.songs]]
+ name = "Dancing in the Dark"
+});
+
+is($actual, $expected1, 'table-array-nest - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'table-array-nest - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'people' => [
+ {
+ 'first_name' => 'Bruce',
+ 'last_name' => 'Springsteen'
+ }
+ ]
+ };
+
+
+my $actual = from_toml(q{[[people]]
+first_name = "Bruce"
+last_name = "Springsteen"
+});
+
+is($actual, $expected1, 'table-array-one - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'table-array-one - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'a' => [
+ {
+ 'b' => [
+ {
+ 'c' => {
+ 'd' => 'val0'
+ }
+ },
+ {
+ 'c' => {
+ 'd' => 'val1'
+ }
+ }
+ ]
+ }
+ ]
+ };
+
+
+my $actual = from_toml(q{[[a]]
+ [[a.b]]
+ [a.b.c]
+ d = "val0"
+ [[a.b]]
+ [a.b.c]
+ d = "val1"
+});
+
+is($actual, $expected1, 'table-array-table-array - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'table-array-table-array - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'a' => {}
+ };
+
+
+my $actual = from_toml(q{[a]
+});
+
+is($actual, $expected1, 'table-empty - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'table-empty - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'table' => {}
+ };
+
+
+my $actual = from_toml(q{[table]});
+
+is($actual, $expected1, 'table-no-eol - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'table-no-eol - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'a' => {
+ 'b' => {}
+ }
+ };
+
+
+my $actual = from_toml(q{[a]
+[a.b]
+});
+
+is($actual, $expected1, 'table-sub-empty - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'table-sub-empty - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'valid key' => {}
+ };
+
+
+my $actual = from_toml(q{["valid key"]
+});
+
+is($actual, $expected1, 'table-whitespace - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'table-whitespace - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'a' => {
+ '"b"' => {
+ 'c' => {
+ 'answer' => bless( {
+ '_file' => '(eval 424)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('42')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>'
+ }, 'Test2::Compare::Custom' )
+ }
+ }
+ }
+ };
+
+
+my $actual = from_toml(q{['a']
+[a.'"b"']
+[a.'"b"'.c]
+answer = 42
+});
+
+is($actual, $expected1, 'table-with-literal-string - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'table-with-literal-string - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'key#group' => {
+ 'answer' => bless( {
+ '_file' => '(eval 425)',
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('42')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ]
+ }, 'Test2::Compare::Custom' )
+ }
+ };
+
+
+my $actual = from_toml(q{["key#group"]
+answer = 42
+});
+
+is($actual, $expected1, 'table-with-pound - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'table-with-pound - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'a' => {
+ 'b' => {
+ 'c' => {
+ 'answer' => bless( {
+ '_file' => '(eval 426)',
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('42')->beq($_);
+ },
+ '_lines' => [
+ 6
+ ],
+ 'name' => '<Custom Code>',
+ 'operator' => 'CODE(...)'
+ }, 'Test2::Compare::Custom' )
+ }
+ }
+ }
+ };
+
+
+my $actual = from_toml(q{['a']
+[a.'b']
+[a.'b'.c]
+answer = 42
+});
+
+is($actual, $expected1, 'table-with-single-quotes - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'table-with-single-quotes - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'electron_mass' => bless( {
+ '_file' => '(eval 427)',
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigFloat;
+ 'Math::BigFloat'->new('9.109109383e-31')->beq($_);
+ }
+ }, 'Test2::Compare::Custom' )
+ };
+
+
+my $actual = from_toml(q{electron_mass = 9_109.109_383e-3_4
+});
+
+is($actual, $expected1, 'underscored-float - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'underscored-float - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'million' => bless( {
+ 'operator' => 'CODE(...)',
+ 'name' => '<Custom Code>',
+ '_lines' => [
+ 6
+ ],
+ 'code' => sub {
+ BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x54"}
+ use strict;
+ no feature ':all';
+ use feature ':5.16';
+ require Math::BigInt;
+ 'Math::BigInt'->new('1000000')->beq($_);
+ },
+ '_file' => '(eval 428)'
+ }, 'Test2::Compare::Custom' )
+ };
+
+
+my $actual = from_toml(q{million = 1_000_000
+});
+
+is($actual, $expected1, 'underscored-integer - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'underscored-integer - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'answer8' => "\x{3b4}",
+ 'answer4' => "\x{3b4}"
+ };
+
+
+my $actual = from_toml(q{answer4 = "\\u03B4"
+answer8 = "\\U000003B4"
+});
+
+is($actual, $expected1, 'unicode-escape - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'unicode-escape - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file
--- /dev/null
+# File automatically generated from BurntSushi/toml-test
+use utf8;
+use Test2::V0;
+use Data::Dumper;
+use TOML::Tiny;
+
+binmode STDIN, ':encoding(UTF-8)';
+binmode STDOUT, ':encoding(UTF-8)';
+
+my $expected1 = {
+ 'answer' => "\x{3b4}"
+ };
+
+
+my $actual = from_toml(q{answer = "δ"
+});
+
+is($actual, $expected1, 'unicode-literal - from_toml') or do{
+ diag 'EXPECTED:';
+ diag Dumper($expected1);
+
+ diag 'ACTUAL:';
+ diag Dumper($actual);
+};
+
+is(eval{ from_toml(to_toml($actual)) }, $actual, 'unicode-literal - to_toml') or do{
+ diag 'INPUT:';
+ diag Dumper($actual);
+
+ diag 'TOML OUTPUT:';
+ diag to_toml($actual);
+
+ diag 'REPARSED OUTPUT:';
+ diag Dumper(from_toml(to_toml($actual)));
+};
+
+done_testing;
\ No newline at end of file