TOML-Tiny-0.20/0000775000175000017500000000000014770631453011567 5ustar olafolafTOML-Tiny-0.20/t/0000775000175000017500000000000014770631453012032 5ustar olafolafTOML-Tiny-0.20/t/toml-test/0000775000175000017500000000000014770631453013762 5ustar olafolafTOML-Tiny-0.20/t/toml-test/invalid/0000775000175000017500000000000014770631453015410 5ustar olafolafTOML-Tiny-0.20/t/toml-test/invalid/table/0000775000175000017500000000000014770631453016477 5ustar olafolafTOML-Tiny-0.20/t/toml-test/invalid/table/rrbrace.toml0000644000175000017500000000001314770631453021004 0ustar olafolaf[[table] ] TOML-Tiny-0.20/t/toml-test/invalid/table/llbrace.toml0000644000175000017500000000001314770631453020770 0ustar olafolaf[ [table]] TOML-Tiny-0.20/t/toml-test/invalid/table/redefine.toml0000644000175000017500000000011614770631453021151 0ustar olafolaf# Define b as int, and try to use it as a table: error [a] b = 1 [a.b] c = 2 TOML-Tiny-0.20/t/toml-test/invalid/table/duplicate-table-array.t0000644000175000017500000000067514770631453023045 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/table/duplicate-table-array.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on table/duplicate-table-array'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/table/text-after-table.t0000644000175000017500000000066314770631453022037 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/table/text-after-table.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on table/text-after-table'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/table/duplicate-table-array2.t0000644000175000017500000000067714770631453023131 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/table/duplicate-table-array2.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on table/duplicate-table-array2'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/table/empty.t0000644000175000017500000000063514770631453020024 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/table/empty.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on table/empty'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/table/array-implicit.t0000644000175000017500000000065714770631453021620 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/table/array-implicit.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on table/array-implicit'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/table/quoted-no-close.toml0000644000175000017500000000004214770631453022404 0ustar olafolaf["where will it end] name = value TOML-Tiny-0.20/t/toml-test/invalid/table/equals-sign.t0000644000175000017500000000065114770631453021114 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/table/equals-sign.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on table/equals-sign'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/table/quoted-no-close.t0000644000175000017500000000066114770631453021703 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/table/quoted-no-close.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on table/quoted-no-close'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/table/nested-brackets-open.t0000644000175000017500000000067314770631453022705 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/table/nested-brackets-open.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on table/nested-brackets-open'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/table/whitespace.t0000644000175000017500000000064714770631453021025 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/table/whitespace.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on table/whitespace'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/table/rrbrace.t0000644000175000017500000000064114770631453020303 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/table/rrbrace.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on table/rrbrace'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/table/array-missing-bracket.t0000644000175000017500000000067514770631453023070 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/table/array-missing-bracket.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on table/array-missing-bracket'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/table/nested-brackets-close.toml0000644000175000017500000000001714770631453023551 0ustar olafolaf[a]b] zyx = 42 TOML-Tiny-0.20/t/toml-test/invalid/table/duplicate-table-array2.toml0000644000175000017500000000001614770631453023624 0ustar olafolaf[[tbl]] [tbl] TOML-Tiny-0.20/t/toml-test/invalid/table/redefine.t0000644000175000017500000000064314770631453020446 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/table/redefine.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on table/redefine'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/table/with-pound.toml0000644000175000017500000000003014770631453021461 0ustar olafolaf[key#group] answer = 42 TOML-Tiny-0.20/t/toml-test/invalid/table/array-missing-bracket.toml0000644000175000017500000000003714770631453023570 0ustar olafolaf[[albums] name = "Born to Run" TOML-Tiny-0.20/t/toml-test/invalid/table/with-pound.t0000644000175000017500000000064714770631453020767 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/table/with-pound.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on table/with-pound'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/table/empty.toml0000644000175000017500000000000314770631453020521 0ustar olafolaf[] TOML-Tiny-0.20/t/toml-test/invalid/table/duplicate.t0000644000175000017500000000064514770631453020641 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/table/duplicate.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on table/duplicate'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/table/llbrace.t0000644000175000017500000000064114770631453020267 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/table/llbrace.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on table/llbrace'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/table/text-after-table.toml0000644000175000017500000000003714770631453022542 0ustar olafolaf[error] this shouldn't be here TOML-Tiny-0.20/t/toml-test/invalid/table/duplicate.toml0000644000175000017500000000002514770631453021341 0ustar olafolaf[a] b = 1 [a] c = 2 TOML-Tiny-0.20/t/toml-test/invalid/table/duplicate-key-table.t0000644000175000017500000000067114770631453022513 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/table/duplicate-key-table.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on table/duplicate-key-table'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/table/duplicate-table-array.toml0000644000175000017500000000001614770631453023542 0ustar olafolaf[tbl] [[tbl]] TOML-Tiny-0.20/t/toml-test/invalid/table/duplicate-key-table.toml0000644000175000017500000000006314770631453023216 0ustar olafolaf[fruit] type = "apple" [fruit.type] apple = "yes" TOML-Tiny-0.20/t/toml-test/invalid/table/equals-sign.toml0000644000175000017500000000001314770631453021614 0ustar olafolaf[name=bad] TOML-Tiny-0.20/t/toml-test/invalid/table/array-empty.t0000644000175000017500000000065114770631453021136 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/table/array-empty.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on table/array-empty'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/table/whitespace.toml0000644000175000017500000000001614770631453021523 0ustar olafolaf[invalid key] TOML-Tiny-0.20/t/toml-test/invalid/table/empty-implicit-table.toml0000644000175000017500000000002314770631453023420 0ustar olafolaf[naughty..naughty] TOML-Tiny-0.20/t/toml-test/invalid/table/nested-brackets-close.t0000644000175000017500000000067514770631453023053 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/table/nested-brackets-close.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on table/nested-brackets-close'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/table/empty-implicit-table.t0000644000175000017500000000067314770631453022723 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/table/empty-implicit-table.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on table/empty-implicit-table'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/table/array-empty.toml0000644000175000017500000000003214770631453021637 0ustar olafolaf[[]] name = "Born to Run" TOML-Tiny-0.20/t/toml-test/invalid/table/nested-brackets-open.toml0000644000175000017500000000001714770631453023405 0ustar olafolaf[a[b] zyx = 42 TOML-Tiny-0.20/t/toml-test/invalid/table/array-implicit.toml0000644000175000017500000000115614770631453022323 0ustar olafolaf# 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" TOML-Tiny-0.20/t/toml-test/invalid/datetime/0000775000175000017500000000000014770631453017204 5ustar olafolafTOML-Tiny-0.20/t/toml-test/invalid/datetime/no-leads.toml0000644000175000017500000000003714770631453021601 0ustar olafolafno-leads = 1987-7-05T17:45:00Z TOML-Tiny-0.20/t/toml-test/invalid/datetime/trailing-t.t0000644000175000017500000000065514770631453021447 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/datetime/trailing-t.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on datetime/trailing-t'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/datetime/no-secs.toml0000644000175000017500000000003414770631453021443 0ustar olafolafno-secs = 1987-07-05T17:45Z TOML-Tiny-0.20/t/toml-test/invalid/datetime/impossible-date.toml0000644000175000017500000000003114770631453023152 0ustar olafolafd = 2006-01-50T00:00:00Z TOML-Tiny-0.20/t/toml-test/invalid/datetime/no-secs.t0000644000175000017500000000064714770631453020745 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/datetime/no-secs.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on datetime/no-secs'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/datetime/no-leads-with-milli.toml0000644000175000017500000000004414770631453023654 0ustar olafolafwith-milli = 1987-07-5T17:45:00.12Z TOML-Tiny-0.20/t/toml-test/invalid/datetime/no-t.t0000644000175000017500000000064114770631453020245 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/datetime/no-t.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on datetime/no-t'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/datetime/no-leads.t0000644000175000017500000000065114770631453021073 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/datetime/no-leads.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on datetime/no-leads'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/datetime/no-t.toml0000644000175000017500000000003314770631453020750 0ustar olafolafno-t = 1987-07-0517:45:00Z TOML-Tiny-0.20/t/toml-test/invalid/datetime/no-leads-with-milli.t0000644000175000017500000000067714770631453023160 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/datetime/no-leads-with-milli.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on datetime/no-leads-with-milli'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/datetime/impossible-date.t0000644000175000017500000000066714770631453022461 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/datetime/impossible-date.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on datetime/impossible-date'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/datetime/trailing-t.toml0000644000175000017500000000002014770631453022141 0ustar olafolafd = 2006-01-30T TOML-Tiny-0.20/t/toml-test/invalid/inline-table/0000775000175000017500000000000014770631453017753 5ustar olafolafTOML-Tiny-0.20/t/toml-test/invalid/inline-table/linebreak-3.t0000644000175000017500000000066714770631453022243 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/inline-table/linebreak-3.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on inline-table/linebreak-3'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/inline-table/empty.t0000644000175000017500000000065314770631453021300 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/inline-table/empty.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on inline-table/empty'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/inline-table/trailing-comma.t0000644000175000017500000000067514770631453023051 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/inline-table/trailing-comma.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on inline-table/trailing-comma'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/inline-table/linebreak-2.t0000644000175000017500000000066714770631453022242 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/inline-table/linebreak-2.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on inline-table/linebreak-2'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/inline-table/linebreak-2.toml0000644000175000017500000000001714770631453022737 0ustar olafolaft = {a=1, b=2} TOML-Tiny-0.20/t/toml-test/invalid/inline-table/linebreak-4.t0000644000175000017500000000066714770631453022244 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/inline-table/linebreak-4.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on inline-table/linebreak-4'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/inline-table/linebreak-4.toml0000644000175000017500000000011314770631453022736 0ustar olafolafjson_like = { first = "Tom", last = "Preston-Werner" } TOML-Tiny-0.20/t/toml-test/invalid/inline-table/no-comma.t0000644000175000017500000000066114770631453021647 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/inline-table/no-comma.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on inline-table/no-comma'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/inline-table/empty.toml0000644000175000017500000000001014770631453021773 0ustar olafolaft = {,} TOML-Tiny-0.20/t/toml-test/invalid/inline-table/double-comma.t0000644000175000017500000000067114770631453022506 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/inline-table/double-comma.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on inline-table/double-comma'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/inline-table/double-comma.toml0000644000175000017500000000001714770631453023210 0ustar olafolaft = {x=3,,y=4} TOML-Tiny-0.20/t/toml-test/invalid/inline-table/linebreak-1.t0000644000175000017500000000066714770631453022241 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/inline-table/linebreak-1.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on inline-table/linebreak-1'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/inline-table/no-comma.toml0000644000175000017500000000002214770631453022346 0ustar olafolaft = {x = 3 y = 4} TOML-Tiny-0.20/t/toml-test/invalid/inline-table/trailing-comma.toml0000644000175000017500000000021414770631453023546 0ustar olafolaf# A terminating comma (also called trailing comma) is not permitted after the # last key/value pair in an inline table abc = { abc = 123, } TOML-Tiny-0.20/t/toml-test/invalid/inline-table/linebreak-1.toml0000644000175000017500000000015714770631453022743 0ustar olafolaf# No newlines are allowed between the curly braces unless they are valid within # a value. simple = { a = 1 } TOML-Tiny-0.20/t/toml-test/invalid/inline-table/linebreak-3.toml0000644000175000017500000000001714770631453022740 0ustar olafolaft = {a=1 ,b=2} TOML-Tiny-0.20/t/toml-test/invalid/control/0000775000175000017500000000000014770631453017070 5ustar olafolafTOML-Tiny-0.20/t/toml-test/invalid/control/rawmulti-null.t0000644000175000017500000000066114770631453022072 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/rawmulti-null.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/rawmulti-null'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/control/string-bs.toml0000644000175000017500000000003114770631453021665 0ustar olafolafstring-bs = "backspace" TOML-Tiny-0.20/t/toml-test/invalid/control/multi-us.toml0000644000175000017500000000002714770631453021541 0ustar olafolafmulti-us = """null""" TOML-Tiny-0.20/t/toml-test/invalid/control/multi-us.t0000644000175000017500000000064714770631453021041 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/multi-us.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/multi-us'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/control/rawmulti-us.toml0000644000175000017500000000003214770631453022247 0ustar olafolafrawmulti-us = '''null''' TOML-Tiny-0.20/t/toml-test/invalid/control/rawmulti-del.toml0000644000175000017500000000003314770631453022365 0ustar olafolafrawmulti-del = '''null''' TOML-Tiny-0.20/t/toml-test/invalid/control/comment-null.t0000644000175000017500000000065714770631453021675 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/comment-null.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/comment-null'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/control/rawmulti-lf.toml0000644000175000017500000000003214770631453022221 0ustar olafolafrawmulti-lf = '''null''' TOML-Tiny-0.20/t/toml-test/invalid/control/multi-lf.t0000644000175000017500000000064714770631453021013 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/multi-lf.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/multi-lf'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/control/rawstring-us.toml0000644000175000017500000000002714770631453022427 0ustar olafolafrawstring-us = 'null' TOML-Tiny-0.20/t/toml-test/invalid/control/string-us.toml0000644000175000017500000000002414770631453021712 0ustar olafolafstring-us = "null" TOML-Tiny-0.20/t/toml-test/invalid/control/rawmulti-lf.t0000644000175000017500000000065514770631453021524 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/rawmulti-lf.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/rawmulti-lf'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/control/rawstring-del.t0000644000175000017500000000066114770631453022040 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/rawstring-del.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/rawstring-del'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/control/comment-del.toml0000644000175000017500000000003114770631453022161 0ustar olafolafcomment-del = "0x7f" #  TOML-Tiny-0.20/t/toml-test/invalid/control/multi-null.toml0000644000175000017500000000003114770631453022057 0ustar olafolafmulti-null = """null""" TOML-Tiny-0.20/t/toml-test/invalid/control/comment-us.t0000644000175000017500000000065314770631453021346 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/comment-us.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/comment-us'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/control/multi-null.t0000644000175000017500000000065314770631453021361 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/multi-null.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/multi-null'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/control/string-lf.t0000644000175000017500000000065114770631453021162 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/string-lf.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/string-lf'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/control/rawmulti-del.t0000644000175000017500000000065714770631453021671 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/rawmulti-del.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/rawmulti-del'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/control/rawstring-lf.toml0000644000175000017500000000002714770631453022401 0ustar olafolafrawstring-lf = 'null' TOML-Tiny-0.20/t/toml-test/invalid/control/string-lf.toml0000644000175000017500000000002414770631453021664 0ustar olafolafstring-lf = "null" TOML-Tiny-0.20/t/toml-test/invalid/control/rawmulti-null.toml0000644000175000017500000000003414770631453022574 0ustar olafolafrawmulti-null = '''null''' TOML-Tiny-0.20/t/toml-test/invalid/control/comment-us.toml0000644000175000017500000000003214770631453022045 0ustar olafolafcomment-us = "ctrl-_" #  TOML-Tiny-0.20/t/toml-test/invalid/control/multi-del.toml0000644000175000017500000000003014770631453021650 0ustar olafolafmulti-del = """null""" TOML-Tiny-0.20/t/toml-test/invalid/control/string-del.t0000644000175000017500000000065314770631453021327 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/string-del.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/string-del'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/control/comment-del.t0000644000175000017500000000065514770631453021465 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/comment-del.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/comment-del'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/control/string-null.t0000644000175000017500000000065514770631453021537 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/string-null.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/string-null'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/control/string-us.t0000644000175000017500000000065114770631453021210 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/string-us.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/string-us'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/control/comment-null.toml0000644000175000017500000000003214770631453022370 0ustar olafolafcomment-null = "null" # TOML-Tiny-0.20/t/toml-test/invalid/control/string-null.toml0000644000175000017500000000002614770631453022237 0ustar olafolafstring-null = "null" TOML-Tiny-0.20/t/toml-test/invalid/control/rawstring-null.t0000644000175000017500000000066314770631453022250 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/rawstring-null.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/rawstring-null'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/control/rawstring-del.toml0000644000175000017500000000003014770631453022536 0ustar olafolafrawstring-del = 'null' TOML-Tiny-0.20/t/toml-test/invalid/control/multi-lf.toml0000644000175000017500000000002714770631453021513 0ustar olafolafmulti-lf = """null""" TOML-Tiny-0.20/t/toml-test/invalid/control/rawstring-null.toml0000644000175000017500000000003114770631453022745 0ustar olafolafrawstring-null = 'null' TOML-Tiny-0.20/t/toml-test/invalid/control/comment-lf.toml0000644000175000017500000000003214770631453022017 0ustar olafolafcomment-lf = "ctrl-P" #  TOML-Tiny-0.20/t/toml-test/invalid/control/comment-lf.t0000644000175000017500000000065314770631453021320 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/comment-lf.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/comment-lf'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/control/rawstring-lf.t0000644000175000017500000000065714770631453021702 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/rawstring-lf.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/rawstring-lf'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/control/string-bs.t0000644000175000017500000000065114770631453021165 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/string-bs.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/string-bs'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/control/string-del.toml0000644000175000017500000000002514770631453022030 0ustar olafolafstring-del = "null" TOML-Tiny-0.20/t/toml-test/invalid/control/rawmulti-us.t0000644000175000017500000000065514770631453021552 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/rawmulti-us.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/rawmulti-us'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/control/rawstring-us.t0000644000175000017500000000065714770631453021730 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/rawstring-us.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/rawstring-us'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/control/multi-del.t0000644000175000017500000000065114770631453021151 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/control/multi-del.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on control/multi-del'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/0000775000175000017500000000000014770631453016515 5ustar olafolafTOML-Tiny-0.20/t/toml-test/invalid/float/double-point-2.t0000644000175000017500000000065714770631453021450 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/double-point-2.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/double-point-2'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/trailing-point-min.t0000644000175000017500000000066714770631453022432 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/trailing-point-min.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/trailing-point-min'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/exp-trailing-us.toml0000644000175000017500000000003114770631453022432 0ustar olafolafexp-trailing-us = 1e_23_ TOML-Tiny-0.20/t/toml-test/invalid/float/us-after-point.t0000644000175000017500000000065714770631453021565 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/us-after-point.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/us-after-point'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/nan-incomplete-2.t0000644000175000017500000000066314770631453021755 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/nan-incomplete-2.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/nan-incomplete-2'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/leading-point.toml0000644000175000017500000000002714770631453022141 0ustar olafolafleading-point = .12345 TOML-Tiny-0.20/t/toml-test/invalid/float/inf-incomplete-1.t0000644000175000017500000000066314770631453021754 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/inf-incomplete-1.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/inf-incomplete-1'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/trailing-point-min.toml0000644000175000017500000000003114770631453023123 0ustar olafolaftrailing-point-min = -1. TOML-Tiny-0.20/t/toml-test/invalid/float/exp-double-e-1.t0000644000175000017500000000065714770631453021334 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/exp-double-e-1.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/exp-double-e-1'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/inf-incomplete-1.toml0000644000175000017500000000002614770631453022455 0ustar olafolafinf-incomplete-1 = in TOML-Tiny-0.20/t/toml-test/invalid/float/exp-point-1.toml0000644000175000017500000000002414770631453021465 0ustar olafolafexp-point-1 = 1e2.3 TOML-Tiny-0.20/t/toml-test/invalid/float/inf-incomplete-2.toml0000644000175000017500000000002714770631453022457 0ustar olafolafinf-incomplete-2 = +in TOML-Tiny-0.20/t/toml-test/invalid/float/trailing-us.t0000644000175000017500000000065114770631453021140 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/trailing-us.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/trailing-us'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/leading-point-plus.toml0000644000175000017500000000003514770631453023121 0ustar olafolafleading-point-plus = +.12345 TOML-Tiny-0.20/t/toml-test/invalid/float/exp-trailing-us.t0000644000175000017500000000066114770631453021733 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/exp-trailing-us.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/exp-trailing-us'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/leading-zero-plus.t0000644000175000017500000000066514770631453022250 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/leading-zero-plus.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/leading-zero-plus'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/inf_underscore.toml0000644000175000017500000000002614770631453022413 0ustar olafolafinf_underscore = in_f TOML-Tiny-0.20/t/toml-test/invalid/float/trailing-point.t0000644000175000017500000000065714770631453021650 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/trailing-point.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/trailing-point'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/double-point-1.t0000644000175000017500000000065714770631453021447 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/double-point-1.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/double-point-1'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/nan_underscore.toml0000644000175000017500000000002614770631453022413 0ustar olafolafnan_underscore = na_n TOML-Tiny-0.20/t/toml-test/invalid/float/us-before-point.t0000644000175000017500000000066114770631453021721 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/us-before-point.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/us-before-point'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/leading-point-neg.t0000644000175000017500000000066514770631453022210 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/leading-point-neg.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/leading-point-neg'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/inf-incomplete-2.t0000644000175000017500000000066314770631453021755 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/inf-incomplete-2.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/inf-incomplete-2'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/leading-zero.t0000644000175000017500000000065314770631453021264 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/leading-zero.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/leading-zero'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/exp-double-us.t0000644000175000017500000000065514770631453021377 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/exp-double-us.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/exp-double-us'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/leading-zero-neg.t0000644000175000017500000000066314770631453022034 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/leading-zero-neg.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/leading-zero-neg'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/us-after-point.toml0000644000175000017500000000002614770631453022263 0ustar olafolafus-after-point = 1._2 TOML-Tiny-0.20/t/toml-test/invalid/float/leading-zero-plus.toml0000644000175000017500000000003314770631453022745 0ustar olafolafleading-zero-plus = +03.14 TOML-Tiny-0.20/t/toml-test/invalid/float/nan-incomplete-3.t0000644000175000017500000000066314770631453021756 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/nan-incomplete-3.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/nan-incomplete-3'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/nan_underscore.t0000644000175000017500000000065714770631453021715 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/nan_underscore.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/nan_underscore'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/nan-incomplete-3.toml0000644000175000017500000000002714770631453022460 0ustar olafolafnan-incomplete-3 = -na TOML-Tiny-0.20/t/toml-test/invalid/float/trailing-point-plus.toml0000644000175000017500000000003214770631453023324 0ustar olafolaftrailing-point-plus = +1. TOML-Tiny-0.20/t/toml-test/invalid/float/double-point-1.toml0000644000175000017500000000002614770631453022145 0ustar olafolafdouble-point-1 = 0..1 TOML-Tiny-0.20/t/toml-test/invalid/float/leading-point.t0000644000175000017500000000065514770631453021440 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/leading-point.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/leading-point'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/exp-leading-us.toml0000644000175000017500000000002714770631453022231 0ustar olafolafexp-leading-us = 1e_23 TOML-Tiny-0.20/t/toml-test/invalid/float/leading-us.toml0000644000175000017500000000002214770631453021432 0ustar olafolafleading-us = _1.2 TOML-Tiny-0.20/t/toml-test/invalid/float/leading-zero.toml0000644000175000017500000000002514770631453021765 0ustar olafolafleading-zero = 03.14 TOML-Tiny-0.20/t/toml-test/invalid/float/inf-incomplete-3.t0000644000175000017500000000066314770631453021756 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/inf-incomplete-3.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/inf-incomplete-3'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/leading-zero-neg.toml0000644000175000017500000000003214770631453022532 0ustar olafolafleading-zero-neg = -03.14 TOML-Tiny-0.20/t/toml-test/invalid/float/exp-leading-us.t0000644000175000017500000000065714770631453021532 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/exp-leading-us.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/exp-leading-us'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/exp-double-e-1.toml0000644000175000017500000000002614770631453022032 0ustar olafolafexp-double-e-1 = 1ee2 TOML-Tiny-0.20/t/toml-test/invalid/float/leading-us.t0000644000175000017500000000064714770631453020737 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/leading-us.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/leading-us'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/inf-incomplete-3.toml0000644000175000017500000000002714770631453022460 0ustar olafolafinf-incomplete-3 = -in TOML-Tiny-0.20/t/toml-test/invalid/float/trailing-us.toml0000644000175000017500000000002314770631453021641 0ustar olafolaftrailing-us = 1.2_ TOML-Tiny-0.20/t/toml-test/invalid/float/us-before-point.toml0000644000175000017500000000002714770631453022425 0ustar olafolafus-before-point = 1_.2 TOML-Tiny-0.20/t/toml-test/invalid/float/nan-incomplete-1.t0000644000175000017500000000066314770631453021754 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/nan-incomplete-1.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/nan-incomplete-1'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/trailing-point-plus.t0000644000175000017500000000067114770631453022625 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/trailing-point-plus.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/trailing-point-plus'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/exp-double-e-2.t0000644000175000017500000000065714770631453021335 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/exp-double-e-2.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/exp-double-e-2'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/nan-incomplete-1.toml0000644000175000017500000000002614770631453022455 0ustar olafolafnan-incomplete-1 = na TOML-Tiny-0.20/t/toml-test/invalid/float/exp-point-1.t0000644000175000017500000000065114770631453020763 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/exp-point-1.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/exp-point-1'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/trailing-point.toml0000644000175000017500000000002414770631453022344 0ustar olafolaftrailing-point = 1. TOML-Tiny-0.20/t/toml-test/invalid/float/leading-point-plus.t0000644000175000017500000000066714770631453022424 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/leading-point-plus.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/leading-point-plus'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/leading-point-neg.toml0000644000175000017500000000003414770631453022706 0ustar olafolafleading-point-neg = -.12345 TOML-Tiny-0.20/t/toml-test/invalid/float/exp-point-2.t0000644000175000017500000000065114770631453020764 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/exp-point-2.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/exp-point-2'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/double-point-2.toml0000644000175000017500000000002714770631453022147 0ustar olafolafdouble-point-2 = 0.1.2 TOML-Tiny-0.20/t/toml-test/invalid/float/exp-double-e-2.toml0000644000175000017500000000002714770631453022034 0ustar olafolafexp-double-e-2 = 1e2e3 TOML-Tiny-0.20/t/toml-test/invalid/float/exp-double-us.toml0000644000175000017500000000002714770631453022100 0ustar olafolafexp-double-us = 1e__23 TOML-Tiny-0.20/t/toml-test/invalid/float/exp-point-2.toml0000644000175000017500000000002314770631453021465 0ustar olafolafexp-point-2 = 1.e2 TOML-Tiny-0.20/t/toml-test/invalid/float/inf_underscore.t0000644000175000017500000000065714770631453021715 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/float/inf_underscore.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on float/inf_underscore'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/float/nan-incomplete-2.toml0000644000175000017500000000002714770631453022457 0ustar olafolafnan-incomplete-2 = +na TOML-Tiny-0.20/t/toml-test/invalid/string/0000775000175000017500000000000014770631453016716 5ustar olafolafTOML-Tiny-0.20/t/toml-test/invalid/string/multiline-quotes-1.toml0000644000175000017500000000003014770631453023260 0ustar olafolafa = """6 quotes: """""" TOML-Tiny-0.20/t/toml-test/invalid/string/bad-concat.toml0000644000175000017500000000003514770631453021602 0ustar olafolafno_concat = "first" "second" TOML-Tiny-0.20/t/toml-test/invalid/string/basic-out-of-range-unicode-escape-2.t0000644000175000017500000000073314770631453025507 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/basic-out-of-range-unicode-escape-2.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/basic-out-of-range-unicode-escape-2'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/bad-codepoint.t0000644000175000017500000000065714770631453021621 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/bad-codepoint.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/bad-codepoint'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/multiline-quotes-1.t0000644000175000017500000000067114770631453022563 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/multiline-quotes-1.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/multiline-quotes-1'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/basic-out-of-range-unicode-escape-2.toml0000644000175000017500000000002114770631453026205 0ustar olafolafa = "\U00D80000" TOML-Tiny-0.20/t/toml-test/invalid/string/multiline-no-close-2.toml0000644000175000017500000000000614770631453023463 0ustar olafolafx=""" TOML-Tiny-0.20/t/toml-test/invalid/string/bad-concat.t0000644000175000017500000000065114770631453021076 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/bad-concat.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/bad-concat'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/basic-byte-escapes.toml0000644000175000017500000000002014770631453023244 0ustar olafolafanswer = "\x33" TOML-Tiny-0.20/t/toml-test/invalid/string/basic-multiline-unknown-escape.toml0000644000175000017500000000001514770631453025621 0ustar olafolafa = """\@""" TOML-Tiny-0.20/t/toml-test/invalid/string/basic-multiline-unknown-escape.t0000644000175000017500000000072114770631453025115 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/basic-multiline-unknown-escape.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/basic-multiline-unknown-escape'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/literal-multiline-quotes-2.toml0000644000175000017500000000005214770631453024717 0ustar olafolafa = '''15 apostrophes: '''''''''''''''''' TOML-Tiny-0.20/t/toml-test/invalid/string/missing-quotes.t0000644000175000017500000000066114770631453022073 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/missing-quotes.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/missing-quotes'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/basic-out-of-range-unicode-escape-1.toml0000644000175000017500000000002114770631453026204 0ustar olafolafa = "\UFFFFFFFF" TOML-Tiny-0.20/t/toml-test/invalid/string/multiline-quotes-2.t0000644000175000017500000000067114770631453022564 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/multiline-quotes-2.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/multiline-quotes-2'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/basic-unknown-escape.t0000644000175000017500000000067514770631453023125 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/basic-unknown-escape.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/basic-unknown-escape'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/bad-byte-escape.toml0000644000175000017500000000002114770631453022527 0ustar olafolafnaughty = "\xAg" TOML-Tiny-0.20/t/toml-test/invalid/string/basic-multiline-out-of-range-unicode-escape-2.toml0000644000175000017500000000002514770631453030211 0ustar olafolafa = """\U00D80000""" TOML-Tiny-0.20/t/toml-test/invalid/string/multiline-escape-space.toml0000644000175000017500000000003414770631453024137 0ustar olafolafa = """ foo \ \n bar""" TOML-Tiny-0.20/t/toml-test/invalid/string/multiline-no-close.t0000644000175000017500000000067114770631453022624 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/multiline-no-close.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/multiline-no-close'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/multiline-no-close.toml0000644000175000017500000000004114770631453023323 0ustar olafolafinvalid = """ this will fail TOML-Tiny-0.20/t/toml-test/invalid/string/bad-escape.t0000644000175000017500000000065114770631453021067 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/bad-escape.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/bad-escape'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/wrong-close.toml0000644000175000017500000000004714770631453022051 0ustar olafolafbad-ending-quote = "double and single' TOML-Tiny-0.20/t/toml-test/invalid/string/multiline-escape-space.t0000644000175000017500000000070114770631453023430 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/multiline-escape-space.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/multiline-escape-space'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/bad-slash-escape.toml0000644000175000017500000000007614770631453022710 0ustar olafolafinvalid-escape = "This string has a bad \/ escape character." TOML-Tiny-0.20/t/toml-test/invalid/string/bad-slash-escape.t0000644000175000017500000000066514770631453022204 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/bad-slash-escape.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/bad-slash-escape'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/bad-uni-esc.t0000644000175000017500000000065314770631453021174 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/bad-uni-esc.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/bad-uni-esc'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/no-close.t0000644000175000017500000000064514770631453020625 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/no-close.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/no-close'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/multiline-quotes-2.toml0000644000175000017500000000003014770631453023261 0ustar olafolafa = """6 quotes: """""" TOML-Tiny-0.20/t/toml-test/invalid/string/basic-multiline-quotes.toml0000644000175000017500000000006214770631453024206 0ustar olafolafstr5 = """Here are three quotation marks: """.""" TOML-Tiny-0.20/t/toml-test/invalid/string/bad-byte-escape.t0000644000175000017500000000066314770631453022033 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/bad-byte-escape.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/bad-byte-escape'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/literal-multiline-quotes-2.t0000644000175000017500000000071114770631453024211 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/literal-multiline-quotes-2.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/literal-multiline-quotes-2'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/basic-multiline-out-of-range-unicode-escape-2.t0000644000175000017500000000075714770631453027515 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/basic-multiline-out-of-range-unicode-escape-2.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/basic-multiline-out-of-range-unicode-escape-2'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/basic-multiline-out-of-range-unicode-escape-1.t0000644000175000017500000000075714770631453027514 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/basic-multiline-out-of-range-unicode-escape-1.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/basic-multiline-out-of-range-unicode-escape-1'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/bad-escape.toml0000644000175000017500000000007614770631453021600 0ustar olafolafinvalid-escape = "This string has a bad \a escape character." TOML-Tiny-0.20/t/toml-test/invalid/string/basic-multiline-quotes.t0000644000175000017500000000070114770631453023476 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/basic-multiline-quotes.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/basic-multiline-quotes'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/text-after-string.toml0000644000175000017500000000005414770631453023177 0ustar olafolafstring = "Is there life after strings?" No. TOML-Tiny-0.20/t/toml-test/invalid/string/missing-quotes.toml0000644000175000017500000000001514770631453022574 0ustar olafolafname = value TOML-Tiny-0.20/t/toml-test/invalid/string/basic-multiline-out-of-range-unicode-escape-1.toml0000644000175000017500000000002514770631453030210 0ustar olafolafa = """\UFFFFFFFF""" TOML-Tiny-0.20/t/toml-test/invalid/string/multiline-no-close-2.t0000644000175000017500000000067514770631453022767 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/multiline-no-close-2.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/multiline-no-close-2'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/basic-unknown-escape.toml0000644000175000017500000000001114770631453023615 0ustar olafolafa = "\@" TOML-Tiny-0.20/t/toml-test/invalid/string/wrong-close.t0000644000175000017500000000065314770631453021344 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/wrong-close.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/wrong-close'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/bad-multiline.toml0000644000175000017500000000004114770631453022332 0ustar olafolafmulti = "first line second line" TOML-Tiny-0.20/t/toml-test/invalid/string/literal-multiline-quotes-1.toml0000644000175000017500000000003614770631453024720 0ustar olafolafa = '''6 apostrophes: '''''' TOML-Tiny-0.20/t/toml-test/invalid/string/literal-multiline-quotes-1.t0000644000175000017500000000071114770631453024210 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/literal-multiline-quotes-1.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/literal-multiline-quotes-1'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/basic-byte-escapes.t0000644000175000017500000000067114770631453022550 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/basic-byte-escapes.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/basic-byte-escapes'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/bad-uni-esc.toml0000644000175000017500000000001714770631453021676 0ustar olafolafstr = "val\ue" TOML-Tiny-0.20/t/toml-test/invalid/string/bad-multiline.t0000644000175000017500000000065714770631453021637 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/bad-multiline.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/bad-multiline'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/basic-out-of-range-unicode-escape-1.t0000644000175000017500000000073314770631453025506 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/basic-out-of-range-unicode-escape-1.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/basic-out-of-range-unicode-escape-1'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/no-close.toml0000644000175000017500000000005214770631453021325 0ustar olafolafno-ending-quote = "One time, at band camp TOML-Tiny-0.20/t/toml-test/invalid/string/text-after-string.t0000644000175000017500000000066714770631453022501 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/string/text-after-string.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on string/text-after-string'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/string/bad-codepoint.toml0000644000175000017500000000012114770631453022313 0ustar olafolafinvalid-codepoint = "This string contains a non scalar unicode codepoint \uD801" TOML-Tiny-0.20/t/toml-test/invalid/integer/0000775000175000017500000000000014770631453017045 5ustar olafolafTOML-Tiny-0.20/t/toml-test/invalid/integer/invalid-bin.toml0000644000175000017500000000002514770631453022131 0ustar olafolafinvalid-bin = 0b0012 TOML-Tiny-0.20/t/toml-test/invalid/integer/leading-us-hex.t0000644000175000017500000000066314770631453022047 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/leading-us-hex.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/leading-us-hex'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/us-after-hex.toml0000644000175000017500000000002414770631453022244 0ustar olafolafus-after-hex = 0x_1 TOML-Tiny-0.20/t/toml-test/invalid/integer/text-after-integer.toml0000644000175000017500000000004114770631453023451 0ustar olafolafanswer = 42 the ultimate answer? TOML-Tiny-0.20/t/toml-test/invalid/integer/capital-bin.toml0000644000175000017500000000002214770631453022115 0ustar olafolafcapital-bin = 0B0 TOML-Tiny-0.20/t/toml-test/invalid/integer/negative-hex.t0000644000175000017500000000065714770631453021624 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/negative-hex.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/negative-hex'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/double-us.toml0000644000175000017500000000002214770631453021631 0ustar olafolafdouble-us = 1__23 TOML-Tiny-0.20/t/toml-test/invalid/integer/leading-zero-sign-1.toml0000644000175000017500000000003214770631453023407 0ustar olafolafleading-zero-sign-1 = -01 TOML-Tiny-0.20/t/toml-test/invalid/integer/us-after-bin.t0000644000175000017500000000065714770631453021534 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/us-after-bin.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/us-after-bin'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/leading-zero-2.t0000644000175000017500000000066314770631453021754 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/leading-zero-2.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/leading-zero-2'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/double-us.t0000644000175000017500000000065114770631453021131 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/double-us.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/double-us'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/positive-bin.t0000644000175000017500000000065714770631453021650 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/positive-bin.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/positive-bin'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/leading-zero-2.toml0000644000175000017500000000002414770631453022453 0ustar olafolafleading-zero-2 = 00 TOML-Tiny-0.20/t/toml-test/invalid/integer/capital-oct.t0000644000175000017500000000065514770631453021436 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/capital-oct.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/capital-oct'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/leading-zero-sign-2.toml0000644000175000017500000000003214770631453023410 0ustar olafolafleading-zero-sign-2 = +01 TOML-Tiny-0.20/t/toml-test/invalid/integer/leading-us-oct.toml0000644000175000017500000000002614770631453022551 0ustar olafolafleading-us-oct = _0o1 TOML-Tiny-0.20/t/toml-test/invalid/integer/positive-bin.toml0000644000175000017500000000003314770631453022344 0ustar olafolafpositive-bin = +0b11010110 TOML-Tiny-0.20/t/toml-test/invalid/integer/leading-zero-sign-2.t0000644000175000017500000000067514770631453022715 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/leading-zero-sign-2.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/leading-zero-sign-2'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/trailing-us-oct.t0000644000175000017500000000066514770631453022260 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/trailing-us-oct.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/trailing-us-oct'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/double-sign-nex.toml0000644000175000017500000000002714770631453022737 0ustar olafolafdouble-sign-nex = --99 TOML-Tiny-0.20/t/toml-test/invalid/integer/text-after-integer.t0000644000175000017500000000067314770631453022754 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/text-after-integer.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/text-after-integer'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/trailing-us.t0000644000175000017500000000065514770631453021474 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/trailing-us.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/trailing-us'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/positive-oct.toml0000644000175000017500000000002514770631453022362 0ustar olafolafpositive-oct = +0o99 TOML-Tiny-0.20/t/toml-test/invalid/integer/invalid-hex.t0000644000175000017500000000065514770631453021446 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/invalid-hex.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/invalid-hex'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/positive-oct.t0000644000175000017500000000065714770631453021665 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/positive-oct.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/positive-oct'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/positive-hex.toml0000644000175000017500000000002514770631453022361 0ustar olafolafpositive-hex = +0xff TOML-Tiny-0.20/t/toml-test/invalid/integer/trailing-us-hex.toml0000644000175000017500000000002714770631453022757 0ustar olafolaftrailing-us-hex = 0x1_ TOML-Tiny-0.20/t/toml-test/invalid/integer/invalid-hex.toml0000644000175000017500000000002514770631453022145 0ustar olafolafinvalid-hex = 0xaafz TOML-Tiny-0.20/t/toml-test/invalid/integer/us-after-bin.toml0000644000175000017500000000002414770631453022230 0ustar olafolafus-after-bin = 0b_1 TOML-Tiny-0.20/t/toml-test/invalid/integer/invalid-bin.t0000644000175000017500000000065514770631453021432 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/invalid-bin.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/invalid-bin'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/capital-bin.t0000644000175000017500000000065514770631453021421 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/capital-bin.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/capital-bin'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/leading-us.toml0000644000175000017500000000002214770631453021762 0ustar olafolafleading-us = _123 TOML-Tiny-0.20/t/toml-test/invalid/integer/capital-hex.toml0000644000175000017500000000002214770631453022131 0ustar olafolafcapital-hex = 0X1 TOML-Tiny-0.20/t/toml-test/invalid/integer/trailing-us-bin.toml0000644000175000017500000000002714770631453022743 0ustar olafolaftrailing-us-bin = 0b1_ TOML-Tiny-0.20/t/toml-test/invalid/integer/capital-oct.toml0000644000175000017500000000002214770631453022132 0ustar olafolafcapital-oct = 0O0 TOML-Tiny-0.20/t/toml-test/invalid/integer/double-sign-plus.toml0000644000175000017500000000003014770631453023122 0ustar olafolafdouble-sign-plus = ++99 TOML-Tiny-0.20/t/toml-test/invalid/integer/leading-us.t0000644000175000017500000000065314770631453021264 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/leading-us.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/leading-us'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/trailing-us.toml0000644000175000017500000000002314770631453022171 0ustar olafolaftrailing-us = 123_ TOML-Tiny-0.20/t/toml-test/invalid/integer/capital-hex.t0000644000175000017500000000065514770631453021435 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/capital-hex.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/capital-hex'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/leading-zero-sign-1.t0000644000175000017500000000067514770631453022714 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/leading-zero-sign-1.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/leading-zero-sign-1'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/leading-zero-1.toml0000644000175000017500000000002414770631453022452 0ustar olafolafleading-zero-1 = 01 TOML-Tiny-0.20/t/toml-test/invalid/integer/negative-oct.t0000644000175000017500000000065714770631453021625 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/negative-oct.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/negative-oct'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/trailing-us-oct.toml0000644000175000017500000000002714770631453022760 0ustar olafolaftrailing-us-oct = 0o1_ TOML-Tiny-0.20/t/toml-test/invalid/integer/negative-hex.toml0000644000175000017500000000002514770631453022321 0ustar olafolafnegative-hex = -0xff TOML-Tiny-0.20/t/toml-test/invalid/integer/leading-us-oct.t0000644000175000017500000000066314770631453022050 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/leading-us-oct.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/leading-us-oct'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/trailing-us-hex.t0000644000175000017500000000066514770631453022257 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/trailing-us-hex.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/trailing-us-hex'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/leading-us-bin.toml0000644000175000017500000000002614770631453022534 0ustar olafolafleading-us-bin = _0o1 TOML-Tiny-0.20/t/toml-test/invalid/integer/double-sign-plus.t0000644000175000017500000000066714770631453022432 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/double-sign-plus.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/double-sign-plus'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/positive-hex.t0000644000175000017500000000065714770631453021664 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/positive-hex.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/positive-hex'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/double-sign-nex.t0000644000175000017500000000066514770631453022237 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/double-sign-nex.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/double-sign-nex'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/us-after-hex.t0000644000175000017500000000065714770631453021550 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/us-after-hex.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/us-after-hex'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/negative-oct.toml0000644000175000017500000000002514770631453022322 0ustar olafolafnegative-oct = -0o99 TOML-Tiny-0.20/t/toml-test/invalid/integer/leading-zero-1.t0000644000175000017500000000066314770631453021753 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/leading-zero-1.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/leading-zero-1'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/leading-us-hex.toml0000644000175000017500000000002614770631453022550 0ustar olafolafleading-us-hex = _0o1 TOML-Tiny-0.20/t/toml-test/invalid/integer/invalid-oct.toml0000644000175000017500000000002414770631453022145 0ustar olafolafinvalid-oct = 0o778 TOML-Tiny-0.20/t/toml-test/invalid/integer/leading-us-bin.t0000644000175000017500000000066314770631453022033 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/leading-us-bin.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/leading-us-bin'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/invalid-oct.t0000644000175000017500000000065514770631453021447 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/invalid-oct.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/invalid-oct'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/negative-bin.toml0000644000175000017500000000003314770631453022304 0ustar olafolafnegative-bin = -0b11010110 TOML-Tiny-0.20/t/toml-test/invalid/integer/trailing-us-bin.t0000644000175000017500000000066514770631453022243 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/trailing-us-bin.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/trailing-us-bin'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/us-after-oct.toml0000644000175000017500000000002414770631453022245 0ustar olafolafus-after-oct = 0o_1 TOML-Tiny-0.20/t/toml-test/invalid/integer/negative-bin.t0000644000175000017500000000065714770631453021610 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/negative-bin.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/negative-bin'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/integer/us-after-oct.t0000644000175000017500000000065714770631453021551 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/integer/us-after-oct.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on integer/us-after-oct'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/encoding/0000775000175000017500000000000014770631453017176 5ustar olafolafTOML-Tiny-0.20/t/toml-test/invalid/encoding/bom-not-at-start-2.toml0000644000175000017500000000002514770631453023335 0ustar olafolafbom-not-at-start= ÿý TOML-Tiny-0.20/t/toml-test/invalid/encoding/bom-not-at-start-2.t0000644000175000017500000000067514770631453022640 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/encoding/bom-not-at-start-2.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on encoding/bom-not-at-start-2'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/encoding/utf16-bom.toml0000644000175000017500000000004614770631453021611 0ustar olafolafþÿ# UTF-16 with BOM TOML-Tiny-0.20/t/toml-test/invalid/encoding/bad-utf8-at-end.toml0000644000175000017500000000036214770631453022652 0ustar olafolaf# There is a 0xda at after the quotes, and no EOL at the end of the file. # # This is a bit of an edge case: This indicates there should be two bytes # (0b1101_1010) but there is no byte to follow because it's the end of the file. x = """"""ÚTOML-Tiny-0.20/t/toml-test/invalid/encoding/bad-utf8-at-end.t0000644000175000017500000000066714770631453022152 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/encoding/bad-utf8-at-end.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on encoding/bad-utf8-at-end'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/encoding/bom-not-at-start-1.t0000644000175000017500000000067514770631453022637 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/encoding/bom-not-at-start-1.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on encoding/bom-not-at-start-1'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/encoding/utf16.toml0000644000175000017500000000005214770631453021033 0ustar olafolaf# UTF-16 without BOM TOML-Tiny-0.20/t/toml-test/invalid/encoding/bad-utf8-in-string.t0000644000175000017500000000067514770631453022713 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/encoding/bad-utf8-in-string.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on encoding/bad-utf8-in-string'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/encoding/utf16-bom.t0000644000175000017500000000065314770631453021105 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/encoding/utf16-bom.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on encoding/utf16-bom'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/encoding/bad-utf8-in-comment.t0000644000175000017500000000067714770631453023051 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/encoding/bad-utf8-in-comment.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on encoding/bad-utf8-in-comment'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/encoding/bom-not-at-start-1.toml0000644000175000017500000000002414770631453023333 0ustar olafolafbom-not-at-start ÿý TOML-Tiny-0.20/t/toml-test/invalid/encoding/bad-utf8-in-comment.toml0000644000175000017500000000000414770631453023541 0ustar olafolaf# à TOML-Tiny-0.20/t/toml-test/invalid/encoding/utf16.t0000644000175000017500000000064314770631453020331 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/encoding/utf16.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on encoding/utf16'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/encoding/bad-utf8-in-string.toml0000644000175000017500000000010314770631453023405 0ustar olafolaf# The following line contains an invalid UTF-8 sequence. bad = "Ã" TOML-Tiny-0.20/t/toml-test/invalid/bool/0000775000175000017500000000000014770631453016343 5ustar olafolafTOML-Tiny-0.20/t/toml-test/invalid/bool/wrong-case-true.t0000644000175000017500000000065714770631453021560 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/bool/wrong-case-true.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on bool/wrong-case-true'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/bool/mixed-case.toml0000644000175000017500000000001614770631453021252 0ustar olafolafvalid = False TOML-Tiny-0.20/t/toml-test/invalid/bool/wrong-case-false.toml0000644000175000017500000000001214770631453022364 0ustar olafolafb = FALSE TOML-Tiny-0.20/t/toml-test/invalid/bool/wrong-case-true.toml0000644000175000017500000000001114770631453022250 0ustar olafolafa = TRUE TOML-Tiny-0.20/t/toml-test/invalid/bool/wrong-case-false.t0000644000175000017500000000066114770631453021666 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/bool/wrong-case-false.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on bool/wrong-case-false'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/bool/mixed-case.t0000644000175000017500000000064514770631453020552 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/bool/mixed-case.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on bool/mixed-case'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/array/0000775000175000017500000000000014770631453016526 5ustar olafolafTOML-Tiny-0.20/t/toml-test/invalid/array/no-close-table.toml0000644000175000017500000000002014770631453022215 0ustar olafolafx = [{ key = 42 TOML-Tiny-0.20/t/toml-test/invalid/array/text-after-array-entries.t0000644000175000017500000000070314770631453023557 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/array/text-after-array-entries.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on array/text-after-array-entries'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/array/text-before-array-separator.t0000644000175000017500000000071114770631453024246 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/array/text-before-array-separator.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on array/text-before-array-separator'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/array/tables-1.toml0000644000175000017500000000006714770631453021034 0ustar olafolaf# INVALID TOML DOC fruit = [] [[fruit]] # Not allowed TOML-Tiny-0.20/t/toml-test/invalid/array/tables-1.t0000644000175000017500000000064314770631453020324 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/array/tables-1.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on array/tables-1'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/array/no-close-2.toml0000644000175000017500000000001214770631453021270 0ustar olafolafx = [42 # TOML-Tiny-0.20/t/toml-test/invalid/array/no-close-table-2.toml0000644000175000017500000000002214770631453022356 0ustar olafolafx = [{ key = 42 # TOML-Tiny-0.20/t/toml-test/invalid/array/tables-2.toml0000644000175000017500000000027414770631453021035 0ustar olafolaf# INVALID TOML DOC [[fruit]] name = "apple" [[fruit.variety]] name = "red delicious" # This table conflicts with the previous table [fruit.variety] name = "granny smith" TOML-Tiny-0.20/t/toml-test/invalid/array/text-in-array.t0000644000175000017500000000065514770631453021423 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/array/text-in-array.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on array/text-in-array'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/array/no-close-table.t0000644000175000017500000000065714770631453021525 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/array/no-close-table.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on array/no-close-table'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/array/no-close.t0000644000175000017500000000064314770631453020433 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/array/no-close.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on array/no-close'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/array/missing-separator.toml0000644000175000017500000000002214770631453023062 0ustar olafolafwrong = [ 1 2 3 ] TOML-Tiny-0.20/t/toml-test/invalid/array/no-close-2.t0000644000175000017500000000064714770631453020576 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/array/no-close-2.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on array/no-close-2'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/array/tables-2.t0000644000175000017500000000064314770631453020325 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/array/tables-2.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on array/tables-2'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/array/text-in-array.toml0000644000175000017500000000007014770631453022122 0ustar olafolafarray = [ "Entry 1", I don't belong, "Entry 2", ] TOML-Tiny-0.20/t/toml-test/invalid/array/text-after-array-entries.toml0000644000175000017500000000010614770631453024264 0ustar olafolafarray = [ "Is there life after an array separator?", No "Entry" ] TOML-Tiny-0.20/t/toml-test/invalid/array/missing-separator.t0000644000175000017500000000066514770631453022367 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/array/missing-separator.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on array/missing-separator'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/array/no-close-table-2.t0000644000175000017500000000066314770631453021661 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/array/no-close-table-2.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on array/no-close-table-2'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/array/text-before-array-separator.toml0000644000175000017500000000010714770631453024755 0ustar olafolafarray = [ "Is there life before an array separator?" No, "Entry" ] TOML-Tiny-0.20/t/toml-test/invalid/array/no-close.toml0000644000175000017500000000002714770631453021137 0ustar olafolaflong_array = [ 1, 2, 3 TOML-Tiny-0.20/t/toml-test/invalid/key/0000775000175000017500000000000014770631453016200 5ustar olafolafTOML-Tiny-0.20/t/toml-test/invalid/key/two-equals.t0000644000175000017500000000064314770631453020467 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/two-equals.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/two-equals'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/hash.toml0000644000175000017500000000000714770631453020013 0ustar olafolafa# = 1 TOML-Tiny-0.20/t/toml-test/invalid/key/newline.toml0000644000175000017500000000002114770631453020525 0ustar olafolafbarekey = 123 TOML-Tiny-0.20/t/toml-test/invalid/key/two-equals2.toml0000644000175000017500000000000514770631453021251 0ustar olafolafa==1 TOML-Tiny-0.20/t/toml-test/invalid/key/space.t0000644000175000017500000000063114770631453017456 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/space.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/space'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/escape.toml0000644000175000017500000000005514770631453020333 0ustar olafolaf\u00c0 = "latin capital letter A with grave" TOML-Tiny-0.20/t/toml-test/invalid/key/duplicate-keys.toml0000644000175000017500000000003114770631453022010 0ustar olafolafdupe = false dupe = true TOML-Tiny-0.20/t/toml-test/invalid/key/two-equals3.toml0000644000175000017500000000000614770631453021253 0ustar olafolafa=b=1 TOML-Tiny-0.20/t/toml-test/invalid/key/empty.t0000644000175000017500000000063114770631453017521 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/empty.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/empty'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/no-eol.t0000644000175000017500000000063314770631453017556 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/no-eol.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/no-eol'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/dotted-redefine-table.t0000644000175000017500000000067114770631453022516 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/dotted-redefine-table.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/dotted-redefine-table'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/hash.t0000644000175000017500000000062714770631453017313 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/hash.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/hash'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/two-equals3.t0000644000175000017500000000064514770631453020554 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/two-equals3.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/two-equals3'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/start-bracket.toml0000644000175000017500000000002114770631453021632 0ustar olafolaf[a] [xyz = 5 [b] TOML-Tiny-0.20/t/toml-test/invalid/key/start-bracket.t0000644000175000017500000000065114770631453021133 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/start-bracket.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/start-bracket'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/bare-invalid-character.t0000644000175000017500000000067314770631453022660 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/bare-invalid-character.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/bare-invalid-character'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/without-value-1.toml0000644000175000017500000000000414770631453022040 0ustar olafolafkey TOML-Tiny-0.20/t/toml-test/invalid/key/without-value-2.t0000644000175000017500000000065514770631453021345 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/without-value-2.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/without-value-2'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/special-character.toml0000644000175000017500000000003514770631453022443 0ustar olafolafμ = "greek small letter mu" TOML-Tiny-0.20/t/toml-test/invalid/key/two-equals.toml0000644000175000017500000000001114770631453021164 0ustar olafolafkey= = 1 TOML-Tiny-0.20/t/toml-test/invalid/key/multiline.toml0000644000175000017500000000002314770631453021070 0ustar olafolaf"""long key""" = 1 TOML-Tiny-0.20/t/toml-test/invalid/key/without-value-1.t0000644000175000017500000000065514770631453021344 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/without-value-1.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/without-value-1'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/single-open-bracket.t0000644000175000017500000000066514770631453022223 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/single-open-bracket.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/single-open-bracket'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/after-table.t0000644000175000017500000000064514770631453020556 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/after-table.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/after-table'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/partial-quoted.t0000644000175000017500000000065314770631453021322 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/partial-quoted.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/partial-quoted'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/empty.toml0000644000175000017500000000000514770631453020224 0ustar olafolaf = 1 TOML-Tiny-0.20/t/toml-test/invalid/key/no-eol.toml0000644000175000017500000000001414770631453020257 0ustar olafolafa = 1 b = 2 TOML-Tiny-0.20/t/toml-test/invalid/key/duplicate.t0000644000175000017500000000064114770631453020336 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/duplicate.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/duplicate'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/space.toml0000644000175000017500000000001014770631453020155 0ustar olafolafa b = 1 TOML-Tiny-0.20/t/toml-test/invalid/key/duplicate-keys.t0000644000175000017500000000065314770631453021312 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/duplicate-keys.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/duplicate-keys'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/special-character.t0000644000175000017500000000066114770631453021740 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/special-character.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/special-character'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/escape.t0000644000175000017500000000063314770631453017625 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/escape.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/escape'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/after-array.t0000644000175000017500000000064514770631453020605 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/after-array.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/after-array'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/duplicate.toml0000644000175000017500000000005714770631453021047 0ustar olafolaf# DO NOT DO THIS name = "Tom" name = "Pradyun" TOML-Tiny-0.20/t/toml-test/invalid/key/after-value.toml0000644000175000017500000000006014770631453021302 0ustar olafolaffirst = "Tom" last = "Preston-Werner" # INVALID TOML-Tiny-0.20/t/toml-test/invalid/key/bare-invalid-character.toml0000644000175000017500000000001714770631453023360 0ustar olafolafbare!key = 123 TOML-Tiny-0.20/t/toml-test/invalid/key/multiline.t0000644000175000017500000000064114770631453020366 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/multiline.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/multiline'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/single-open-bracket.toml0000644000175000017500000000000214770631453022714 0ustar olafolaf[ TOML-Tiny-0.20/t/toml-test/invalid/key/after-table.toml0000644000175000017500000000004414770631453021257 0ustar olafolaf[error] this = "should not be here" TOML-Tiny-0.20/t/toml-test/invalid/key/without-value-2.toml0000644000175000017500000000000714770631453022044 0ustar olafolafkey = TOML-Tiny-0.20/t/toml-test/invalid/key/after-array.toml0000644000175000017500000000004014770631453021302 0ustar olafolaf[[agencies]] owner = "S Cjelli" TOML-Tiny-0.20/t/toml-test/invalid/key/open-bracket.toml0000644000175000017500000000001114770631453021435 0ustar olafolaf[abc = 1 TOML-Tiny-0.20/t/toml-test/invalid/key/dotted-redefine-table.toml0000644000175000017500000000011414770631453023216 0ustar olafolaf# Defined a.b as int a.b = 1 # Tries to access it as table: error a.b.c = 2 TOML-Tiny-0.20/t/toml-test/invalid/key/after-value.t0000644000175000017500000000064514770631453020603 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/after-value.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/after-value'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/partial-quoted.toml0000644000175000017500000000002414770631453022022 0ustar olafolafpartial"quoted" = 5 TOML-Tiny-0.20/t/toml-test/invalid/key/open-bracket.t0000644000175000017500000000064714770631453020744 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/open-bracket.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/open-bracket'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/newline.t0000644000175000017500000000063514770631453020030 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/newline.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/newline'; done_testing;TOML-Tiny-0.20/t/toml-test/invalid/key/two-equals2.t0000644000175000017500000000064514770631453020553 0ustar olafolaf# 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)'; open my $fh, '<', "./t/toml-test/invalid/key/two-equals2.toml" or die $!; binmode $fh, ':raw'; my $toml = do{ local $/; <$fh>; }; close $fh; ok dies(sub{ scalar from_toml($toml, strict => 1) }), 'strict_mode dies on key/two-equals2'; done_testing;TOML-Tiny-0.20/t/toml-test/valid/0000775000175000017500000000000014770631453015061 5ustar olafolafTOML-Tiny-0.20/t/toml-test/valid/implicit-and-explicit-before.toml0000644000175000017500000000004514770631453023404 0ustar olafolaf[a] better = 43 [a.b.c] answer = 42 TOML-Tiny-0.20/t/toml-test/valid/implicit-and-explicit-after.t0000644000175000017500000001053214770631453022535 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/implicit-and-explicit-after.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "a" => { "b" => { "c" => { "answer" => bless( { "_file" => "(eval 198)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('42')->beq($got); }, "name" => "Math::BigInt->new(\"42\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } }, "better" => bless( { "_file" => "(eval 197)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('43')->beq($got); }, "name" => "Math::BigInt->new(\"43\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } }; my $actual = from_toml($toml); is($actual, $expected1, 'implicit-and-explicit-after - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'implicit-and-explicit-after - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'implicit-and-explicit-after - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/spec-example-1.toml0000644000175000017500000000105714770631453020500 0ustar olafolaf# This is a TOML document. Boom. title = "TOML Example" [owner] name = "Lance Uppercut" dob = 1979-05-27T07:32:00-08:00 # First class dates? Why not? [database] server = "192.168.1.1" ports = [ 8001, 8001, 8002 ] connection_max = 5000 enabled = true [servers] # You can indent as you please. Tabs or spaces. TOML don't care. [servers.alpha] ip = "10.0.0.1" dc = "eqdc10" [servers.beta] ip = "10.0.0.2" dc = "eqdc10" [clients] data = [ ["gamma", "delta"], [1, 2] ] # Line breaks are OK when inside arrays hosts = [ "alpha", "omega" ] TOML-Tiny-0.20/t/toml-test/valid/spec-example-1-compact.t0000644000175000017500000002667414770631453021430 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/spec-example-1-compact.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "clients" => { "data" => [ [ "gamma", "delta" ], [ bless( { "_file" => "(eval 304)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 305)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('2')->beq($got); }, "name" => "Math::BigInt->new(\"2\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) ] ], "hosts" => [ "alpha", "omega" ] }, "database" => { "connection_max" => bless( { "_file" => "(eval 303)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('5000')->beq($got); }, "name" => "Math::BigInt->new(\"5000\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "enabled" => 1, "ports" => [ bless( { "_file" => "(eval 300)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('8001')->beq($got); }, "name" => "Math::BigInt->new(\"8001\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 301)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('8001')->beq($got); }, "name" => "Math::BigInt->new(\"8001\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 302)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('8002')->beq($got); }, "name" => "Math::BigInt->new(\"8002\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) ], "server" => "192.168.1.1" }, "owner" => { "dob" => "1979-05-27T07:32:00-08:00", "name" => "Lance Uppercut" }, "servers" => { "alpha" => { "dc" => "eqdc10", "ip" => "10.0.0.1" }, "beta" => { "dc" => "eqdc10", "ip" => "10.0.0.2" } }, "title" => "TOML Example" }; my $actual = from_toml($toml); is($actual, $expected1, 'spec-example-1-compact - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'spec-example-1-compact - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'spec-example-1-compact - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/spec-example-1.t0000644000175000017500000002663414770631453020000 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/spec-example-1.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "clients" => { "data" => [ [ "gamma", "delta" ], [ bless( { "_file" => "(eval 298)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 299)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('2')->beq($got); }, "name" => "Math::BigInt->new(\"2\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) ] ], "hosts" => [ "alpha", "omega" ] }, "database" => { "connection_max" => bless( { "_file" => "(eval 297)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('5000')->beq($got); }, "name" => "Math::BigInt->new(\"5000\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "enabled" => 1, "ports" => [ bless( { "_file" => "(eval 294)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('8001')->beq($got); }, "name" => "Math::BigInt->new(\"8001\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 295)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('8001')->beq($got); }, "name" => "Math::BigInt->new(\"8001\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 296)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('8002')->beq($got); }, "name" => "Math::BigInt->new(\"8002\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) ], "server" => "192.168.1.1" }, "owner" => { "dob" => "1979-05-27T07:32:00-08:00", "name" => "Lance Uppercut" }, "servers" => { "alpha" => { "dc" => "eqdc10", "ip" => "10.0.0.1" }, "beta" => { "dc" => "eqdc10", "ip" => "10.0.0.2" } }, "title" => "TOML Example" }; my $actual = from_toml($toml); is($actual, $expected1, 'spec-example-1 - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'spec-example-1 - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'spec-example-1 - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/comment/0000775000175000017500000000000014770631453016523 5ustar olafolafTOML-Tiny-0.20/t/toml-test/valid/comment/everywhere.t0000644000175000017500000001277114770631453021103 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/comment/everywhere.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "group" => { "answer" => bless( { "_file" => "(eval 155)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('42')->beq($got); }, "name" => "Math::BigInt->new(\"42\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "d" => "1979-05-27T07:32:12-07:00", "more" => [ bless( { "_file" => "(eval 153)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('42')->beq($got); }, "name" => "Math::BigInt->new(\"42\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 154)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('42')->beq($got); }, "name" => "Math::BigInt->new(\"42\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) ] } }; my $actual = from_toml($toml); is($actual, $expected1, 'comment/everywhere - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'comment/everywhere - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'comment/everywhere - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/comment/at-eof2.toml0000644000175000017500000000012514770631453020651 0ustar olafolaf# This is a full-line comment key = "value" # This is a comment at the end of a line TOML-Tiny-0.20/t/toml-test/valid/comment/at-eof.t0000644000175000017500000000240114770631453020056 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/comment/at-eof.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "key" => "value" }; my $actual = from_toml($toml); is($actual, $expected1, 'comment/at-eof - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'comment/at-eof - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'comment/at-eof - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/comment/tricky.t0000644000175000017500000003326414770631453020223 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/comment/tricky.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "hash#tag" => { "#!" => "hash bang", "arr3" => [ "#", "#", "###" ], "arr4" => [ bless( { "_file" => "(eval 160)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 161)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('2')->beq($got); }, "name" => "Math::BigInt->new(\"2\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 162)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('3')->beq($got); }, "name" => "Math::BigInt->new(\"3\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 163)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('4')->beq($got); }, "name" => "Math::BigInt->new(\"4\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) ], "arr5" => [ [ [ [ [ "#" ] ] ] ] ], "tbl1" => { "#" => "}#" } }, "section" => { "8" => "eight", "eleven" => bless( { "_file" => "(eval 158)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('11.1')->beq($got); }, "name" => "Math::BigFloat->new(\"11.1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "five" => bless( { "_file" => "(eval 156)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('5.5')->beq($got); }, "name" => "Math::BigFloat->new(\"5.5\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "four" => "# no comment\n# nor this\n#also not comment", "one" => 11, "six" => bless( { "_file" => "(eval 157)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('6')->beq($got); }, "name" => "Math::BigInt->new(\"6\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "ten" => bless( { "_file" => "(eval 159)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('1000.0')->beq($got); }, "name" => "Math::BigFloat->new(\"1000.0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "three" => "#", "two" => "22#" } }; my $actual = from_toml($toml); is($actual, $expected1, 'comment/tricky - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'comment/tricky - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'comment/tricky - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/comment/everywhere.toml0000644000175000017500000000105414770631453021603 0ustar olafolaf# 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. # Make sure the space between the datetime and "#" isn't lexed. d = 1979-05-27T07:32:12-07:00 # c TOML-Tiny-0.20/t/toml-test/valid/comment/tricky.toml0000644000175000017500000000060114770631453020720 0ustar olafolaf[section]#attached comment #[notsection] one = "11"#cmt two = "22#" three = '#' four = """# no comment # nor this #also not comment"""#is_comment five = 5.5#66 six = 6#7 8 = "eight" #nine = 99 ten = 10e2#1 eleven = 1.11e1#23 ["hash#tag"] "#!" = "hash bang" arr3 = [ "#", '#', """###""" ] arr4 = [ 1,# 9, 9, 2#,9 ,#9 3#] ,4] arr5 = [[[[#["#"], ["#"]]]]#] ] tbl1 = { "#" = '}#'}#}} TOML-Tiny-0.20/t/toml-test/valid/comment/at-eof2.t0000644000175000017500000000240514770631453020144 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/comment/at-eof2.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "key" => "value" }; my $actual = from_toml($toml); is($actual, $expected1, 'comment/at-eof2 - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'comment/at-eof2 - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'comment/at-eof2 - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/comment/at-eof.toml0000644000175000017500000000012514770631453020567 0ustar olafolaf# This is a full-line comment key = "value" # This is a comment at the end of a line TOML-Tiny-0.20/t/toml-test/valid/table/0000775000175000017500000000000014770631453016150 5ustar olafolafTOML-Tiny-0.20/t/toml-test/valid/table/with-literal-string.t0000644000175000017500000000617714770631453022257 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/table/with-literal-string.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "a" => { "\"b\"" => { "c" => { "answer" => bless( { "_file" => "(eval 306)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('42')->beq($got); }, "name" => "Math::BigInt->new(\"42\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } } } }; my $actual = from_toml($toml); is($actual, $expected1, 'table/with-literal-string - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'table/with-literal-string - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'table/with-literal-string - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/table/sub-empty.t0000644000175000017500000000246714770631453020271 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/table/sub-empty.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "a" => { "b" => {} } }; my $actual = from_toml($toml); is($actual, $expected1, 'table/sub-empty - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'table/sub-empty - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'table/sub-empty - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/table/empty.t0000644000175000017500000000235614770631453017477 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/table/empty.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "a" => {} }; my $actual = from_toml($toml); is($actual, $expected1, 'table/empty - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'table/empty - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'table/empty - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/table/no-eol.t0000644000175000017500000000236614770631453017533 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/table/no-eol.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "table" => {} }; my $actual = from_toml($toml); is($actual, $expected1, 'table/no-eol - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'table/no-eol - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'table/no-eol - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/table/array-implicit.t0000644000175000017500000000304214770631453021260 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/table/array-implicit.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "albums" => { "songs" => [ { "name" => "Glory Days" } ] } }; my $actual = from_toml($toml); is($actual, $expected1, 'table/array-implicit - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'table/array-implicit - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'table/array-implicit - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/table/names.t0000644000175000017500000000415314770631453017441 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/table/names.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "a" => { " x " => {}, "b" => { "c" => {} }, "b.c" => {}, "d.e" => {} }, "d" => { "e" => { "f" => {} } }, "g" => { "h" => { "i" => {} } }, "j" => { "\x{29e}" => { "l" => {} } }, "x" => { "1" => { "2" => {} } } }; my $actual = from_toml($toml); is($actual, $expected1, 'table/names - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'table/names - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'table/names - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/table/sub-empty.toml0000644000175000017500000000001214770631453020761 0ustar olafolaf[a] [a.b] TOML-Tiny-0.20/t/toml-test/valid/table/array-table-array.t0000644000175000017500000000356414770631453021662 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/table/array-table-array.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "a" => [ { "b" => [ { "c" => { "d" => "val0" } }, { "c" => { "d" => "val1" } } ] } ] }; my $actual = from_toml($toml); is($actual, $expected1, 'table/array-table-array - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'table/array-table-array - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'table/array-table-array - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/table/whitespace.t0000644000175000017500000000241214770631453020466 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/table/whitespace.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "valid key" => {} }; my $actual = from_toml($toml); is($actual, $expected1, 'table/whitespace - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'table/whitespace - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'table/whitespace - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/table/without-super.toml0000644000175000017500000000017014770631453021700 0ustar olafolaf# [x] you # [x.y] don't # [x.y.z] need these [x.y.z.w] # for this to work [x] # defining a super-table afterwards is ok TOML-Tiny-0.20/t/toml-test/valid/table/array-one.toml0000644000175000017500000000007214770631453020737 0ustar olafolaf[[people]] first_name = "Bruce" last_name = "Springsteen" TOML-Tiny-0.20/t/toml-test/valid/table/array-nest.toml0000644000175000017500000000040614770631453021130 0ustar olafolaf[[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" TOML-Tiny-0.20/t/toml-test/valid/table/with-pound.toml0000644000175000017500000000003214770631453021134 0ustar olafolaf["key#group"] answer = 42 TOML-Tiny-0.20/t/toml-test/valid/table/with-pound.t0000644000175000017500000000532714770631453020440 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/table/with-pound.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "key#group" => { "answer" => bless( { "_file" => "(eval 307)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('42')->beq($got); }, "name" => "Math::BigInt->new(\"42\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } }; my $actual = from_toml($toml); is($actual, $expected1, 'table/with-pound - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'table/with-pound - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'table/with-pound - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/table/array-many.t0000644000175000017500000000345614770631453020423 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/table/array-many.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "people" => [ { "first_name" => "Bruce", "last_name" => "Springsteen" }, { "first_name" => "Eric", "last_name" => "Clapton" }, { "first_name" => "Bob", "last_name" => "Seger" } ] }; my $actual = from_toml($toml); is($actual, $expected1, 'table/array-many - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'table/array-many - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'table/array-many - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/table/empty.toml0000644000175000017500000000000414770631453020173 0ustar olafolaf[a] TOML-Tiny-0.20/t/toml-test/valid/table/no-eol.toml0000644000175000017500000000001014770631453020223 0ustar olafolaf[table] TOML-Tiny-0.20/t/toml-test/valid/table/with-literal-string.toml0000644000175000017500000000005114770631453022750 0ustar olafolaf['a'] [a.'"b"'] [a.'"b"'.c] answer = 42 TOML-Tiny-0.20/t/toml-test/valid/table/names.toml0000644000175000017500000000013214770631453020142 0ustar olafolaf[a.b.c] [a."b.c"] [a.'d.e'] [a.' x '] [ d.e.f ] [ g . h . i ] [ j . "Êž" . 'l' ] [x.1.2] TOML-Tiny-0.20/t/toml-test/valid/table/array-many.toml0000644000175000017500000000024314770631453021122 0ustar olafolaf[[people]] first_name = "Bruce" last_name = "Springsteen" [[people]] first_name = "Eric" last_name = "Clapton" [[people]] first_name = "Bob" last_name = "Seger" TOML-Tiny-0.20/t/toml-test/valid/table/with-single-quotes.t0000644000175000017500000000604714770631453022112 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/table/with-single-quotes.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "a" => { "b" => { "c" => { "answer" => bless( { "_file" => "(eval 308)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('42')->beq($got); }, "name" => "Math::BigInt->new(\"42\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } } } }; my $actual = from_toml($toml); is($actual, $expected1, 'table/with-single-quotes - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'table/with-single-quotes - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'table/with-single-quotes - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/table/keyword.t0000644000175000017500000000251714770631453020024 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/table/keyword.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "false" => {}, "inf" => {}, "nan" => {}, "true" => {} }; my $actual = from_toml($toml); is($actual, $expected1, 'table/keyword - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'table/keyword - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'table/keyword - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/table/array-table-array.toml0000644000175000017500000000015414770631453022362 0ustar olafolaf[[a]] [[a.b]] [a.b.c] d = "val0" [[a.b]] [a.b.c] d = "val1" TOML-Tiny-0.20/t/toml-test/valid/table/whitespace.toml0000644000175000017500000000001614770631453021174 0ustar olafolaf["valid key"] TOML-Tiny-0.20/t/toml-test/valid/table/without-super.t0000644000175000017500000000275714770631453021205 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/table/without-super.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "x" => { "y" => { "z" => { "w" => {} } } } }; my $actual = from_toml($toml); is($actual, $expected1, 'table/without-super - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'table/without-super - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'table/without-super - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/table/array-nest.t0000644000175000017500000000454114770631453020424 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/table/array-nest.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "albums" => [ { "name" => "Born to Run", "songs" => [ { "name" => "Jungleland" }, { "name" => "Meeting Across the River" } ] }, { "name" => "Born in the USA", "songs" => [ { "name" => "Glory Days" }, { "name" => "Dancing in the Dark" } ] } ] }; my $actual = from_toml($toml); is($actual, $expected1, 'table/array-nest - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'table/array-nest - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'table/array-nest - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/table/with-single-quotes.toml0000644000175000017500000000004514770631453022612 0ustar olafolaf['a'] [a.'b'] [a.'b'.c] answer = 42 TOML-Tiny-0.20/t/toml-test/valid/table/keyword.toml0000644000175000017500000000004014770631453020521 0ustar olafolaf[true] [false] [inf] [nan] TOML-Tiny-0.20/t/toml-test/valid/table/array-implicit.toml0000644000175000017500000000004514770631453021770 0ustar olafolaf[[albums.songs]] name = "Glory Days" TOML-Tiny-0.20/t/toml-test/valid/table/array-one.t0000644000175000017500000000272114770631453020232 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/table/array-one.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "people" => [ { "first_name" => "Bruce", "last_name" => "Springsteen" } ] }; my $actual = from_toml($toml); is($actual, $expected1, 'table/array-one - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'table/array-one - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'table/array-one - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/datetime/0000775000175000017500000000000014770631453016655 5ustar olafolafTOML-Tiny-0.20/t/toml-test/valid/datetime/local-time.toml0000644000175000017500000000006414770631453021576 0ustar olafolafbesttimeever = 17:45:00 milliseconds = 10:32:00.555 TOML-Tiny-0.20/t/toml-test/valid/datetime/local-time.t0000644000175000017500000000252214770631453021067 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/datetime/local-time.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "besttimeever" => "17:45:00", "milliseconds" => "10:32:00.555" }; my $actual = from_toml($toml); is($actual, $expected1, 'datetime/local-time - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'datetime/local-time - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'datetime/local-time - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/datetime/milliseconds.toml0000644000175000017500000000022014770631453022227 0ustar olafolafutc1 = 1987-07-05T17:45:56.123456Z utc2 = 1987-07-05T17:45:56.6Z wita1 = 1987-07-05T17:45:56.123456+08:00 wita2 = 1987-07-05T17:45:56.6+08:00 TOML-Tiny-0.20/t/toml-test/valid/datetime/datetime.t0000644000175000017500000000252014770631453020633 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/datetime/datetime.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "lower" => "1987-07-05T17:45:00Z", "space" => "1987-07-05T17:45:00Z" }; my $actual = from_toml($toml); is($actual, $expected1, 'datetime/datetime - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'datetime/datetime - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'datetime/datetime - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/datetime/local-date.t0000644000175000017500000000244214770631453021047 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/datetime/local-date.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "bestdayever" => "1987-07-05" }; my $actual = from_toml($toml); is($actual, $expected1, 'datetime/local-date - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'datetime/local-date - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'datetime/local-date - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/datetime/local-date.toml0000644000175000017500000000003114770631453021547 0ustar olafolafbestdayever = 1987-07-05 TOML-Tiny-0.20/t/toml-test/valid/datetime/milliseconds.t0000644000175000017500000000276414770631453021536 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/datetime/milliseconds.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "utc1" => "1987-07-05T17:45:56.123456000Z", "utc2" => "1987-07-05T17:45:56.600000000Z", "wita1" => "1987-07-05T17:45:56.123456000+08:00", "wita2" => "1987-07-05T17:45:56.600000000+08:00" }; my $actual = from_toml($toml); is($actual, $expected1, 'datetime/milliseconds - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'datetime/milliseconds - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'datetime/milliseconds - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/datetime/local.toml0000644000175000017500000000013014770631453020634 0ustar olafolaflocal = 1987-07-05T17:45:00 milli = 1977-12-21T10:32:00.555 space = 1987-07-05 17:45:00 TOML-Tiny-0.20/t/toml-test/valid/datetime/timezone.t0000644000175000017500000000267514770631453020704 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/datetime/timezone.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "nzdt" => "1987-07-05T17:45:56+13:00", "nzst" => "1987-07-05T17:45:56+12:00", "pdt" => "1987-07-05T17:45:56-05:00", "utc" => "1987-07-05T17:45:56Z" }; my $actual = from_toml($toml); is($actual, $expected1, 'datetime/timezone - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'datetime/timezone - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'datetime/timezone - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/datetime/local.t0000644000175000017500000000256714770631453020144 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/datetime/local.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "local" => "1987-07-05T17:45:00", "milli" => "1977-12-21T10:32:00.555", "space" => "1987-07-05T17:45:00" }; my $actual = from_toml($toml); is($actual, $expected1, 'datetime/local - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'datetime/local - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'datetime/local - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/datetime/timezone.toml0000644000175000017500000000020614770631453021400 0ustar olafolafutc = 1987-07-05T17:45:56Z pdt = 1987-07-05T17:45:56-05:00 nzst = 1987-07-05T17:45:56+12:00 nzdt = 1987-07-05T17:45:56+13:00 # DST TOML-Tiny-0.20/t/toml-test/valid/datetime/datetime.toml0000644000175000017500000000007214770631453021343 0ustar olafolafspace = 1987-07-05 17:45:00Z lower = 1987-07-05t17:45:00z TOML-Tiny-0.20/t/toml-test/valid/inline-table/0000775000175000017500000000000014770631453017424 5ustar olafolafTOML-Tiny-0.20/t/toml-test/valid/inline-table/inline-table.toml0000644000175000017500000000023514770631453022662 0ustar olafolafname = { first = "Tom", last = "Preston-Werner" } point = { x = 1, y = 2 } simple = { a = 1 } str-key = { "a" = 1 } table-array = [{ "a" = 1 }, { "b" = 2 }] TOML-Tiny-0.20/t/toml-test/valid/inline-table/array.t0000644000175000017500000000346614770631453020736 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/inline-table/array.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "people" => [ { "first_name" => "Bruce", "last_name" => "Springsteen" }, { "first_name" => "Eric", "last_name" => "Clapton" }, { "first_name" => "Bob", "last_name" => "Seger" } ] }; my $actual = from_toml($toml); is($actual, $expected1, 'inline-table/array - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'inline-table/array - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'inline-table/array - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/inline-table/key-dotted.toml0000644000175000017500000000046414770631453022374 0ustar olafolafinline = {a.b = 42} many.dots.here.dot.dot.dot = {a.b.c = 1, a.b.d = 2} a = { a.b = 1 } b = { "a"."b" = 1 } c = { a . b = 1 } d = { 'a' . "b" = 1 } e = {a.b=1} [tbl] a.b.c = {d.e=1} [tbl.x] a.b.c = {d.e=1} [[arr]] t = {a.b=1} T = {a.b=1} [[arr]] t = {a.b=2} T = {a.b=2} TOML-Tiny-0.20/t/toml-test/valid/inline-table/empty.t0000644000175000017500000001223514770631453020750 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/inline-table/empty.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "empty1" => {}, "empty2" => {}, "empty_in_array" => [ { "not_empty" => bless( { "_file" => "(eval 203)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }, {} ], "empty_in_array2" => [ {}, { "not_empty" => bless( { "_file" => "(eval 202)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } ], "many_empty" => [ {}, {}, {} ], "nested_empty" => { "empty" => {} } }; my $actual = from_toml($toml); is($actual, $expected1, 'inline-table/empty - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'inline-table/empty - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'inline-table/empty - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/inline-table/bool.t0000644000175000017500000000254014770631453020543 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/inline-table/bool.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "a" => { "a" => 1, "b" => 0 } }; my $actual = from_toml($toml); is($actual, $expected1, 'inline-table/bool - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'inline-table/bool - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'inline-table/bool - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/inline-table/nest.toml0000644000175000017500000000056414770631453021275 0ustar olafolaftbl_tbl_empty = { tbl_0 = {} } tbl_tbl_val = { tbl_1 = { one = 1 } } tbl_arr_tbl = { arr_tbl = [ { one = 1 } ] } arr_tbl_tbl = [ { tbl = { one = 1 } } ] # Array-of-array-of-table is interesting because it can only # be represented in inline form. arr_arr_tbl_empty = [ [ {} ] ] arr_arr_tbl_val = [ [ { one = 1 } ] ] arr_arr_tbls = [ [ { one = 1 }, { two = 2 } ] ] TOML-Tiny-0.20/t/toml-test/valid/inline-table/multiline.toml0000644000175000017500000000013014770631453022313 0ustar olafolaftbl_multiline = { a = 1, b = """ multiline """, c = """and yet another line""", d = 4 } TOML-Tiny-0.20/t/toml-test/valid/inline-table/array.toml0000644000175000017500000000025214770631453021434 0ustar olafolafpeople = [{first_name = "Bruce", last_name = "Springsteen"}, {first_name = "Eric", last_name = "Clapton"}, {first_name = "Bob", last_name = "Seger"}] TOML-Tiny-0.20/t/toml-test/valid/inline-table/nest.t0000644000175000017500000003024214770631453020561 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/inline-table/nest.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "arr_arr_tbl_empty" => [ [ {} ] ], "arr_arr_tbl_val" => [ [ { "one" => bless( { "_file" => "(eval 228)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } ] ], "arr_arr_tbls" => [ [ { "one" => bless( { "_file" => "(eval 226)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }, { "two" => bless( { "_file" => "(eval 227)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('2')->beq($got); }, "name" => "Math::BigInt->new(\"2\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } ] ], "arr_tbl_tbl" => [ { "tbl" => { "one" => bless( { "_file" => "(eval 230)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } } ], "tbl_arr_tbl" => { "arr_tbl" => [ { "one" => bless( { "_file" => "(eval 231)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } ] }, "tbl_tbl_empty" => { "tbl_0" => {} }, "tbl_tbl_val" => { "tbl_1" => { "one" => bless( { "_file" => "(eval 229)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } } }; my $actual = from_toml($toml); is($actual, $expected1, 'inline-table/nest - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'inline-table/nest - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'inline-table/nest - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/inline-table/empty.toml0000644000175000017500000000023514770631453021455 0ustar olafolafempty1 = {} empty2 = { } empty_in_array = [ { not_empty = 1 }, {} ] empty_in_array2 = [{},{not_empty=1}] many_empty = [{},{},{}] nested_empty = {"empty"={}} TOML-Tiny-0.20/t/toml-test/valid/inline-table/end-in-bool.t0000644000175000017500000000273314770631453021717 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/inline-table/end-in-bool.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "black" => { "allow_prereleases" => 1, "python" => ">3.6", "version" => ">=18.9b0" } }; my $actual = from_toml($toml); is($actual, $expected1, 'inline-table/end-in-bool - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'inline-table/end-in-bool - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'inline-table/end-in-bool - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/inline-table/bool.toml0000644000175000017500000000003214770631453021245 0ustar olafolafa = {a = true, b = false} TOML-Tiny-0.20/t/toml-test/valid/inline-table/end-in-bool.toml0000644000175000017500000000010614770631453022417 0ustar olafolafblack = { python=">3.6", version=">=18.9b0", allow_prereleases=true } TOML-Tiny-0.20/t/toml-test/valid/inline-table/multiline.t0000644000175000017500000001037614770631453021620 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/inline-table/multiline.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "tbl_multiline" => { "a" => bless( { "_file" => "(eval 224)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "b" => "multiline\n", "c" => "and yet\nanother line", "d" => bless( { "_file" => "(eval 225)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('4')->beq($got); }, "name" => "Math::BigInt->new(\"4\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } }; my $actual = from_toml($toml); is($actual, $expected1, 'inline-table/multiline - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'inline-table/multiline - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'inline-table/multiline - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/inline-table/inline-table.t0000644000175000017500000002334314770631453022157 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/inline-table/inline-table.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "name" => { "first" => "Tom", "last" => "Preston-Werner" }, "point" => { "x" => bless( { "_file" => "(eval 207)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "y" => bless( { "_file" => "(eval 208)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('2')->beq($got); }, "name" => "Math::BigInt->new(\"2\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }, "simple" => { "a" => bless( { "_file" => "(eval 209)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }, "str-key" => { "a" => bless( { "_file" => "(eval 204)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }, "table-array" => [ { "a" => bless( { "_file" => "(eval 205)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }, { "b" => bless( { "_file" => "(eval 206)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('2')->beq($got); }, "name" => "Math::BigInt->new(\"2\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } ] }; my $actual = from_toml($toml); is($actual, $expected1, 'inline-table/inline-table - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'inline-table/inline-table - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'inline-table/inline-table - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/inline-table/key-dotted.t0000644000175000017500000007002614770631453021665 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/inline-table/key-dotted.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "a" => { "a" => { "b" => bless( { "_file" => "(eval 222)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } }, "arr" => [ { "T" => { "a" => { "b" => bless( { "_file" => "(eval 219)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } }, "t" => { "a" => { "b" => bless( { "_file" => "(eval 218)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } } }, { "T" => { "a" => { "b" => bless( { "_file" => "(eval 221)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('2')->beq($got); }, "name" => "Math::BigInt->new(\"2\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } }, "t" => { "a" => { "b" => bless( { "_file" => "(eval 220)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('2')->beq($got); }, "name" => "Math::BigInt->new(\"2\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } } } ], "b" => { "a" => { "b" => bless( { "_file" => "(eval 223)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } }, "c" => { "a" => { "b" => bless( { "_file" => "(eval 211)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } }, "d" => { "a" => { "b" => bless( { "_file" => "(eval 210)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } }, "e" => { "a" => { "b" => bless( { "_file" => "(eval 212)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } }, "inline" => { "a" => { "b" => bless( { "_file" => "(eval 215)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('42')->beq($got); }, "name" => "Math::BigInt->new(\"42\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } }, "many" => { "dots" => { "here" => { "dot" => { "dot" => { "dot" => { "a" => { "b" => { "c" => bless( { "_file" => "(eval 213)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "d" => bless( { "_file" => "(eval 214)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('2')->beq($got); }, "name" => "Math::BigInt->new(\"2\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } } } } } } } }, "tbl" => { "a" => { "b" => { "c" => { "d" => { "e" => bless( { "_file" => "(eval 217)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } } } }, "x" => { "a" => { "b" => { "c" => { "d" => { "e" => bless( { "_file" => "(eval 216)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } } } } } } }; my $actual = from_toml($toml); is($actual, $expected1, 'inline-table/key-dotted - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'inline-table/key-dotted - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'inline-table/key-dotted - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/newline-lf.toml0000644000175000017500000000003314770631453020010 0ustar olafolafos = "unix" newline = "lf" TOML-Tiny-0.20/t/toml-test/valid/empty-file.t0000644000175000017500000000230314770631453017315 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/empty-file.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = {}; my $actual = from_toml($toml); is($actual, $expected1, 'empty-file - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'empty-file - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'empty-file - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/newline-lf.t0000644000175000017500000000242114770631453017303 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/newline-lf.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "newline" => "lf", "os" => "unix" }; my $actual = from_toml($toml); is($actual, $expected1, 'newline-lf - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'newline-lf - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'newline-lf - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/implicit-and-explicit-before.t0000644000175000017500000001053614770631453022702 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/implicit-and-explicit-before.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "a" => { "b" => { "c" => { "answer" => bless( { "_file" => "(eval 200)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('42')->beq($got); }, "name" => "Math::BigInt->new(\"42\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } }, "better" => bless( { "_file" => "(eval 199)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('43')->beq($got); }, "name" => "Math::BigInt->new(\"43\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } }; my $actual = from_toml($toml); is($actual, $expected1, 'implicit-and-explicit-before - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'implicit-and-explicit-before - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'implicit-and-explicit-before - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/implicit-and-explicit-after.toml0000644000175000017500000000004514770631453023243 0ustar olafolaf[a.b.c] answer = 42 [a] better = 43 TOML-Tiny-0.20/t/toml-test/valid/example.toml0000644000175000017500000000013314770631453017404 0ustar olafolafbest-day-ever = 1987-07-05T17:45:00Z [numtheory] boring = false perfection = [6, 28, 496] TOML-Tiny-0.20/t/toml-test/valid/implicit-groups.t0000644000175000017500000000600314770631453020372 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/implicit-groups.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "a" => { "b" => { "c" => { "answer" => bless( { "_file" => "(eval 201)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('42')->beq($got); }, "name" => "Math::BigInt->new(\"42\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } } } }; my $actual = from_toml($toml); is($actual, $expected1, 'implicit-groups - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'implicit-groups - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'implicit-groups - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/float/0000775000175000017500000000000014770631453016166 5ustar olafolafTOML-Tiny-0.20/t/toml-test/valid/float/long.t0000644000175000017500000000715514770631453017320 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/float/long.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "longpi" => bless( { "_file" => "(eval 185)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('3.141592653589793')->beq($got); }, "name" => "Math::BigFloat->new(\"3.141592653589793\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "neglongpi" => bless( { "_file" => "(eval 186)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('-3.141592653589793')->beq($got); }, "name" => "Math::BigFloat->new(\"-3.141592653589793\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }; my $actual = from_toml($toml); is($actual, $expected1, 'float/long - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'float/long - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'float/long - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/float/exponent.toml0000644000175000017500000000016214770631453020720 0ustar olafolaflower = 3e2 upper = 3E2 neg = 3e-2 pos = 3E+2 zero = 3e0 pointlower = 3.1e2 pointupper = 3.1E2 minustenth = -1E-1 TOML-Tiny-0.20/t/toml-test/valid/float/underscore.toml0000644000175000017500000000007014770631453021227 0ustar olafolafbefore = 3_141.5927 after = 3141.592_7 exponent = 3e1_4 TOML-Tiny-0.20/t/toml-test/valid/float/underscore.t0000644000175000017500000001133714770631453020527 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/float/underscore.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "after" => bless( { "_file" => "(eval 187)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('3141.5927')->beq($got); }, "name" => "Math::BigFloat->new(\"3141.5927\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "before" => bless( { "_file" => "(eval 189)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('3141.5927')->beq($got); }, "name" => "Math::BigFloat->new(\"3141.5927\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "exponent" => bless( { "_file" => "(eval 188)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('3.0e14')->beq($got); }, "name" => "Math::BigFloat->new(\"3.0e14\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }; my $actual = from_toml($toml); is($actual, $expected1, 'float/underscore - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'float/underscore - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'float/underscore - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/float/zero.t0000644000175000017500000002140014770631453017325 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/float/zero.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "f1" => bless( { "_file" => "(eval 194)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('0')->beq($got); }, "name" => "Math::BigFloat->new(\"0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "f2" => bless( { "_file" => "(eval 196)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('0')->beq($got); }, "name" => "Math::BigFloat->new(\"0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "f3" => bless( { "_file" => "(eval 192)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('0')->beq($got); }, "name" => "Math::BigFloat->new(\"0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "f4" => bless( { "_file" => "(eval 193)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('0')->beq($got); }, "name" => "Math::BigFloat->new(\"0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "f5" => bless( { "_file" => "(eval 195)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('0')->beq($got); }, "name" => "Math::BigFloat->new(\"0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "f6" => bless( { "_file" => "(eval 191)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('0')->beq($got); }, "name" => "Math::BigFloat->new(\"0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "f7" => bless( { "_file" => "(eval 190)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('0')->beq($got); }, "name" => "Math::BigFloat->new(\"0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }; my $actual = from_toml($toml); is($actual, $expected1, 'float/zero - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'float/zero - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'float/zero - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/float/zero.toml0000644000175000017500000000010414770631453020033 0ustar olafolaff1 = 0.0 f2 = +0.0 f3 = -0.0 f4 = 0e0 f5 = 0e00 f6 = +0e0 f7 = -0e0 TOML-Tiny-0.20/t/toml-test/valid/float/float.t0000644000175000017500000001350014770631453017455 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/float/float.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "negpi" => bless( { "_file" => "(eval 175)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('-3.14')->beq($got); }, "name" => "Math::BigFloat->new(\"-3.14\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "pi" => bless( { "_file" => "(eval 176)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('3.14')->beq($got); }, "name" => "Math::BigFloat->new(\"3.14\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "pospi" => bless( { "_file" => "(eval 178)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('3.14')->beq($got); }, "name" => "Math::BigFloat->new(\"3.14\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "zero-intpart" => bless( { "_file" => "(eval 177)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('0.123')->beq($got); }, "name" => "Math::BigFloat->new(\"0.123\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }; my $actual = from_toml($toml); is($actual, $expected1, 'float/float - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'float/float - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'float/float - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/float/exponent.t0000644000175000017500000002473214770631453020221 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/float/exponent.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "lower" => bless( { "_file" => "(eval 173)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('300.0')->beq($got); }, "name" => "Math::BigFloat->new(\"300.0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "minustenth" => bless( { "_file" => "(eval 170)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('-0.1')->beq($got); }, "name" => "Math::BigFloat->new(\"-0.1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "neg" => bless( { "_file" => "(eval 167)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('0.03')->beq($got); }, "name" => "Math::BigFloat->new(\"0.03\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "pointlower" => bless( { "_file" => "(eval 172)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('310.0')->beq($got); }, "name" => "Math::BigFloat->new(\"310.0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "pointupper" => bless( { "_file" => "(eval 169)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('310.0')->beq($got); }, "name" => "Math::BigFloat->new(\"310.0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "pos" => bless( { "_file" => "(eval 171)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('300.0')->beq($got); }, "name" => "Math::BigFloat->new(\"300.0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "upper" => bless( { "_file" => "(eval 174)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('300.0')->beq($got); }, "name" => "Math::BigFloat->new(\"300.0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "zero" => bless( { "_file" => "(eval 168)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('3.0')->beq($got); }, "name" => "Math::BigFloat->new(\"3.0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }; my $actual = from_toml($toml); is($actual, $expected1, 'float/exponent - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'float/exponent - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'float/exponent - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/float/long.toml0000644000175000017500000000007214770631453020017 0ustar olafolaflongpi = 3.141592653589793 neglongpi = -3.141592653589793 TOML-Tiny-0.20/t/toml-test/valid/float/inf-and-nan.t0000644000175000017500000001760614770631453020451 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/float/inf-and-nan.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "infinity" => bless( { "_file" => "(eval 181)", "_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\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; 'Math::BigFloat'->new($_)->is_inf; }, "name" => "Math::BigFloat->new(\$_)->is_inf", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "infinity_neg" => bless( { "_file" => "(eval 180)", "_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\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; 'Math::BigFloat'->new($_)->is_inf; }, "name" => "Math::BigFloat->new(\$_)->is_inf", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "infinity_plus" => bless( { "_file" => "(eval 184)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('+inf')->beq($got); }, "name" => "Math::BigFloat->new(\"+inf\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "nan" => bless( { "_file" => "(eval 183)", "_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\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; 'Math::BigFloat'->new($_)->is_nan; }, "name" => "Math::BigFloat->new(\$_)->is_nan", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "nan_neg" => bless( { "_file" => "(eval 179)", "_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\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; 'Math::BigFloat'->new($_)->is_nan; }, "name" => "Math::BigFloat->new(\$_)->is_nan", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "nan_plus" => bless( { "_file" => "(eval 182)", "_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\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; 'Math::BigFloat'->new($_)->is_nan; }, "name" => "Math::BigFloat->new(\$_)->is_nan", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }; my $actual = from_toml($toml); is($actual, $expected1, 'float/inf-and-nan - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'float/inf-and-nan - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'float/inf-and-nan - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/float/inf-and-nan.toml0000644000175000017500000000035014770631453021145 0ustar olafolaf# We don't encode +nan and -nan back with the signs; many languages don't # support a sign on NaN (it doesn't really make much sense). nan = nan nan_neg = -nan nan_plus = +nan infinity = inf infinity_neg = -inf infinity_plus = +inf TOML-Tiny-0.20/t/toml-test/valid/float/float.toml0000644000175000017500000000007314770631453020166 0ustar olafolafpi = 3.14 pospi = +3.14 negpi = -3.14 zero-intpart = 0.123 TOML-Tiny-0.20/t/toml-test/valid/string/0000775000175000017500000000000014770631453016367 5ustar olafolafTOML-Tiny-0.20/t/toml-test/valid/string/escaped-escape.t0000644000175000017500000000244014770631453021414 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/string/escaped-escape.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "answer" => "\\x64" }; my $actual = from_toml($toml); is($actual, $expected1, 'string/escaped-escape - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'string/escaped-escape - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'string/escaped-escape - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/string/unicode-literal.toml0000644000175000017500000000001614770631453022337 0ustar olafolafanswer = "δ" TOML-Tiny-0.20/t/toml-test/valid/string/multiline-quotes.t0000644000175000017500000000333514770631453022076 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/string/multiline-quotes.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "lit_one" => "'one quote'", "lit_one_space" => " 'one quote' ", "lit_two" => "''two quotes''", "lit_two_space" => " ''two quotes'' ", "mismatch1" => "aaa'''bbb", "mismatch2" => "aaa\"\"\"bbb", "one" => "\"one quote\"", "one_space" => " \"one quote\" ", "two" => "\"\"two quotes\"\"", "two_space" => " \"\"two quotes\"\" " }; my $actual = from_toml($toml); is($actual, $expected1, 'string/multiline-quotes - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'string/multiline-quotes - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'string/multiline-quotes - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/string/escape-tricky.toml0000644000175000017500000000051014770631453022021 0ustar olafolafend_esc = "String does not end here\" but ends here\\" lit_end_esc = 'String ends here\' multiline_unicode = """ \u00a0""" multiline_not_unicode = """ \\u0041""" multiline_end_esc = """When will it end? \"""...""\" should be here\"""" lit_multiline_not_unicode = ''' \u007f''' lit_multiline_end = '''There is no escape\''' TOML-Tiny-0.20/t/toml-test/valid/string/empty.t0000644000175000017500000000236714770631453017720 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/string/empty.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "answer" => "" }; my $actual = from_toml($toml); is($actual, $expected1, 'string/empty - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'string/empty - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'string/empty - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/string/escapes.toml0000644000175000017500000000140314770631453020703 0ustar olafolafbackspace = "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." delete = "This string has a \u007F delete control code." unitseparator = "This string has a \u001F unit separator control code." TOML-Tiny-0.20/t/toml-test/valid/string/escape-tricky.t0000644000175000017500000000326014770631453021316 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/string/escape-tricky.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "end_esc" => "String does not end here\" but ends here\\", "lit_end_esc" => "String ends here\\", "lit_multiline_end" => "There is no escape\\", "lit_multiline_not_unicode" => "\\u007f", "multiline_end_esc" => "When will it end? \"\"\"...\"\"\" should be here\"", "multiline_not_unicode" => "\\u0041", "multiline_unicode" => "\x{a0}" }; my $actual = from_toml($toml); is($actual, $expected1, 'string/escape-tricky - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'string/escape-tricky - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'string/escape-tricky - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/string/unicode-escape.t0000644000175000017500000000251214770631453021436 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/string/unicode-escape.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "answer4" => "\x{3b4}", "answer8" => "\x{3b4}" }; my $actual = from_toml($toml); is($actual, $expected1, 'string/unicode-escape - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'string/unicode-escape - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'string/unicode-escape - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/string/raw.t0000644000175000017500000000332214770631453017343 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/string/raw.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "backslash" => "This string has a \\\\ backslash character.", "backspace" => "This string has a \\b backspace character.", "carriage" => "This string has a \\r carriage return character.", "formfeed" => "This string has a \\f form feed character.", "newline" => "This string has a \\n new line character.", "slash" => "This string has a \\/ slash character.", "tab" => "This string has a \\t tab character." }; my $actual = from_toml($toml); is($actual, $expected1, 'string/raw - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'string/raw - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'string/raw - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/string/raw-multiline.t0000644000175000017500000000275214770631453021351 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/string/raw-multiline.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "firstnl" => "This string has a ' quote character.", "multiline" => "This string\nhas ' a quote character\nand more than\none newline\nin it.", "oneline" => "This string has a ' quote character." }; my $actual = from_toml($toml); is($actual, $expected1, 'string/raw-multiline - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'string/raw-multiline - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'string/raw-multiline - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/string/double-quote-escape.t0000644000175000017500000000246414770631453022423 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/string/double-quote-escape.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "test" => "\"one\"" }; my $actual = from_toml($toml); is($actual, $expected1, 'string/double-quote-escape - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'string/double-quote-escape - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'string/double-quote-escape - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/string/simple.toml0000644000175000017500000000005714770631453020555 0ustar olafolafanswer = "You are not drinking enough whisky." TOML-Tiny-0.20/t/toml-test/valid/string/with-pound.toml0000644000175000017500000000016114770631453021356 0ustar olafolafpound = "We see no # comments here." poundcomment = "But there are # some comments here." # Did I # mess you up? TOML-Tiny-0.20/t/toml-test/valid/string/with-pound.t0000644000175000017500000000255414770631453020656 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/string/with-pound.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "pound" => "We see no # comments here.", "poundcomment" => "But there are # some comments here." }; my $actual = from_toml($toml); is($actual, $expected1, 'string/with-pound - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'string/with-pound - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'string/with-pound - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/string/empty.toml0000644000175000017500000000001414770631453020413 0ustar olafolafanswer = "" TOML-Tiny-0.20/t/toml-test/valid/string/nl.t0000644000175000017500000000263014770631453017164 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/string/nl.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "lit_nl_end" => "value\\n", "lit_nl_mid" => "val\\nue", "lit_nl_uni" => "val\\ue", "nl_end" => "value\n", "nl_mid" => "val\nue" }; my $actual = from_toml($toml); is($actual, $expected1, 'string/nl - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'string/nl - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'string/nl - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/string/multiline-quotes.toml0000644000175000017500000000070014770631453022577 0ustar olafolaf# Make sure that quotes inside multiline strings are allowed, including right # after the opening '''/""" and before the closing '''/""" lit_one = ''''one quote'''' lit_two = '''''two quotes''''' lit_one_space = ''' 'one quote' ''' lit_two_space = ''' ''two quotes'' ''' one = """"one quote"""" two = """""two quotes""""" one_space = """ "one quote" """ two_space = """ ""two quotes"" """ mismatch1 = """aaa'''bbb""" mismatch2 = '''aaa"""bbb''' TOML-Tiny-0.20/t/toml-test/valid/string/raw-multiline.toml0000644000175000017500000000030314770631453022047 0ustar olafolafoneline = '''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.''' TOML-Tiny-0.20/t/toml-test/valid/string/unicode-escape.toml0000644000175000017500000000005214770631453022143 0ustar olafolafanswer4 = "\u03B4" answer8 = "\U000003B4" TOML-Tiny-0.20/t/toml-test/valid/string/unicode-literal.t0000644000175000017500000000244614770631453021640 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/string/unicode-literal.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "answer" => "\x{3b4}" }; my $actual = from_toml($toml); is($actual, $expected1, 'string/unicode-literal - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'string/unicode-literal - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'string/unicode-literal - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/string/raw.toml0000644000175000017500000000056514770631453020061 0ustar olafolafbackspace = '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.' TOML-Tiny-0.20/t/toml-test/valid/string/escaped-escape.toml0000644000175000017500000000002114770631453022115 0ustar olafolafanswer = "\\x64" TOML-Tiny-0.20/t/toml-test/valid/string/nl.toml0000644000175000017500000000016314770631453017673 0ustar olafolafnl_mid = "val\nue" nl_end = """value\n""" lit_nl_end = '''value\n''' lit_nl_mid = 'val\nue' lit_nl_uni = 'val\ue' TOML-Tiny-0.20/t/toml-test/valid/string/double-quote-escape.toml0000644000175000017500000000002114770631453023116 0ustar olafolaftest = "\"one\"" TOML-Tiny-0.20/t/toml-test/valid/string/escapes.t0000644000175000017500000000431414770631453020177 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/string/escapes.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "backslash" => "This string has a \\ backslash character.", "backspace" => "This string has a \b backspace character.", "carriage" => "This string has a \r carriage return character.", "delete" => "This string has a \177 delete control code.", "formfeed" => "This string has a \f form feed character.", "newline" => "This string has a \n new line character.", "notunicode1" => "This string does not have a unicode \\u escape.", "notunicode2" => "This string does not have a unicode \\u escape.", "notunicode3" => "This string does not have a unicode \\u0075 escape.", "notunicode4" => "This string does not have a unicode \\u escape.", "quote" => "This string has a \" quote character.", "tab" => "This string has a \t tab character.", "unitseparator" => "This string has a \37 unit separator control code." }; my $actual = from_toml($toml); is($actual, $expected1, 'string/escapes - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'string/escapes - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'string/escapes - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/string/simple.t0000644000175000017500000000243614770631453020050 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/string/simple.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "answer" => "You are not drinking enough whisky." }; my $actual = from_toml($toml); is($actual, $expected1, 'string/simple - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'string/simple - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'string/simple - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/integer/0000775000175000017500000000000014770631453016516 5ustar olafolafTOML-Tiny-0.20/t/toml-test/valid/integer/long.t0000644000175000017500000000734414770631453017650 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/integer/long.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "int64-max" => bless( { "_file" => "(eval 245)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('9223372036854775807')->beq($got); }, "name" => "Math::BigInt->new(\"9223372036854775807\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "int64-max-neg" => bless( { "_file" => "(eval 246)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('-9223372036854775808')->beq($got); }, "name" => "Math::BigInt->new(\"-9223372036854775808\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }; my $actual = from_toml($toml); is($actual, $expected1, 'integer/long - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'integer/long - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'integer/long - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/integer/literals.toml0000644000175000017500000000022714770631453021231 0ustar olafolafbin1 = 0b11010110 bin2 = 0b1_0_1 oct1 = 0o01234567 oct2 = 0o755 oct3 = 0o7_6_5 hex1 = 0xDEADBEEF hex2 = 0xdeadbeef hex3 = 0xdead_beef hex4 = 0x00987 TOML-Tiny-0.20/t/toml-test/valid/integer/underscore.toml0000644000175000017500000000003114770631453021554 0ustar olafolafkilo = 1_000 x = 1_1_1_1 TOML-Tiny-0.20/t/toml-test/valid/integer/underscore.t0000644000175000017500000000663514770631453021064 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/integer/underscore.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "kilo" => bless( { "_file" => "(eval 247)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1000')->beq($got); }, "name" => "Math::BigInt->new(\"1000\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "x" => bless( { "_file" => "(eval 248)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1111')->beq($got); }, "name" => "Math::BigInt->new(\"1111\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }; my $actual = from_toml($toml); is($actual, $expected1, 'integer/underscore - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'integer/underscore - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'integer/underscore - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/integer/integer.t0000644000175000017500000001354014770631453020341 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/integer/integer.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "answer" => bless( { "_file" => "(eval 234)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('42')->beq($got); }, "name" => "Math::BigInt->new(\"42\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "neganswer" => bless( { "_file" => "(eval 233)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('-42')->beq($got); }, "name" => "Math::BigInt->new(\"-42\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "posanswer" => bless( { "_file" => "(eval 235)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('42')->beq($got); }, "name" => "Math::BigInt->new(\"42\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "zero" => bless( { "_file" => "(eval 232)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('0')->beq($got); }, "name" => "Math::BigInt->new(\"0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }; my $actual = from_toml($toml); is($actual, $expected1, 'integer/integer - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'integer/integer - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'integer/integer - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/integer/zero.t0000644000175000017500000003407014770631453017664 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/integer/zero.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "a2" => bless( { "_file" => "(eval 258)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('0')->beq($got); }, "name" => "Math::BigInt->new(\"0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "a3" => bless( { "_file" => "(eval 249)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('0')->beq($got); }, "name" => "Math::BigInt->new(\"0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "b1" => bless( { "_file" => "(eval 253)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('0')->beq($got); }, "name" => "Math::BigInt->new(\"0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "b2" => bless( { "_file" => "(eval 260)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('0')->beq($got); }, "name" => "Math::BigInt->new(\"0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "b3" => bless( { "_file" => "(eval 252)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('0')->beq($got); }, "name" => "Math::BigInt->new(\"0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "d1" => bless( { "_file" => "(eval 256)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('0')->beq($got); }, "name" => "Math::BigInt->new(\"0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "d2" => bless( { "_file" => "(eval 250)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('0')->beq($got); }, "name" => "Math::BigInt->new(\"0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "d3" => bless( { "_file" => "(eval 259)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('0')->beq($got); }, "name" => "Math::BigInt->new(\"0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "h1" => bless( { "_file" => "(eval 251)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('0')->beq($got); }, "name" => "Math::BigInt->new(\"0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "h2" => bless( { "_file" => "(eval 255)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('0')->beq($got); }, "name" => "Math::BigInt->new(\"0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "h3" => bless( { "_file" => "(eval 254)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('0')->beq($got); }, "name" => "Math::BigInt->new(\"0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "o1" => bless( { "_file" => "(eval 257)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('0')->beq($got); }, "name" => "Math::BigInt->new(\"0\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }; my $actual = from_toml($toml); is($actual, $expected1, 'integer/zero - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'integer/zero - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'integer/zero - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/integer/zero.toml0000644000175000017500000000017214770631453020370 0ustar olafolafd1 = 0 d2 = +0 d3 = -0 h1 = 0x0 h2 = 0x00 h3 = 0x00000 o1 = 0o0 a2 = 0o00 a3 = 0o00000 b1 = 0b0 b2 = 0b00 b3 = 0b00000 TOML-Tiny-0.20/t/toml-test/valid/integer/long.toml0000644000175000017500000000010514770631453020344 0ustar olafolafint64-max = 9223372036854775807 int64-max-neg = -9223372036854775808 TOML-Tiny-0.20/t/toml-test/valid/integer/integer.toml0000644000175000017500000000006514770631453021047 0ustar olafolafanswer = 42 posanswer = +42 neganswer = -42 zero = 0 TOML-Tiny-0.20/t/toml-test/valid/integer/literals.t0000644000175000017500000002636414770631453020533 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/integer/literals.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "bin1" => bless( { "_file" => "(eval 236)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('214')->beq($got); }, "name" => "Math::BigInt->new(\"214\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "bin2" => bless( { "_file" => "(eval 244)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('5')->beq($got); }, "name" => "Math::BigInt->new(\"5\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "hex1" => bless( { "_file" => "(eval 237)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('3735928559')->beq($got); }, "name" => "Math::BigInt->new(\"3735928559\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "hex2" => bless( { "_file" => "(eval 242)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('3735928559')->beq($got); }, "name" => "Math::BigInt->new(\"3735928559\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "hex3" => bless( { "_file" => "(eval 243)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('3735928559')->beq($got); }, "name" => "Math::BigInt->new(\"3735928559\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "hex4" => bless( { "_file" => "(eval 240)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('2439')->beq($got); }, "name" => "Math::BigInt->new(\"2439\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "oct1" => bless( { "_file" => "(eval 241)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('342391')->beq($got); }, "name" => "Math::BigInt->new(\"342391\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "oct2" => bless( { "_file" => "(eval 239)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('493')->beq($got); }, "name" => "Math::BigInt->new(\"493\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "oct3" => bless( { "_file" => "(eval 238)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('501')->beq($got); }, "name" => "Math::BigInt->new(\"501\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }; my $actual = from_toml($toml); is($actual, $expected1, 'integer/literals - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'integer/literals - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'integer/literals - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/newline-crlf.toml0000644000175000017500000000003614770631453020340 0ustar olafolafos = "DOS" newline = "crlf" TOML-Tiny-0.20/t/toml-test/valid/implicit-groups.toml0000644000175000017500000000002414770631453021077 0ustar olafolaf[a.b.c] answer = 42 TOML-Tiny-0.20/t/toml-test/valid/bool/0000775000175000017500000000000014770631453016014 5ustar olafolafTOML-Tiny-0.20/t/toml-test/valid/bool/bool.t0000644000175000017500000000277514770631453017145 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; use constant CORE_BOOL => defined &builtin::is_bool; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/bool/bool.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "f" => 0, "t" => 1 }; my $actual = from_toml($toml); is($actual, $expected1, 'bool/bool - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'bool/bool - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'bool/bool - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; subtest 'builtin booleans' => sub { plan skip_all => 'No builtin::is_bool', unless CORE_BOOL; my $data = { t => !!1, f => !!0 }; my $toml = to_toml($data); is $toml, $regenerated; }; done_testing; TOML-Tiny-0.20/t/toml-test/valid/bool/bool.toml0000644000175000017500000000002314770631453017635 0ustar olafolaft = true f = false TOML-Tiny-0.20/t/toml-test/valid/spec-example-1-compact.toml0000644000175000017500000000057014770631453022123 0ustar olafolaf#Useless spaces eliminated. title="TOML Example" [owner] name="Lance Uppercut" dob=1979-05-27T07:32:00-08:00#First class dates [database] server="192.168.1.1" ports=[8001,8001,8002] connection_max=5000 enabled=true [servers] [servers.alpha] ip="10.0.0.1" dc="eqdc10" [servers.beta] ip="10.0.0.2" dc="eqdc10" [clients] data=[["gamma","delta"],[1,2]] hosts=[ "alpha", "omega" ] TOML-Tiny-0.20/t/toml-test/valid/empty-file.toml0000644000175000017500000000000014770631453020015 0ustar olafolafTOML-Tiny-0.20/t/toml-test/valid/example.t0000644000175000017500000001402114770631453016675 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/example.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "best-day-ever" => "1987-07-05T17:45:00Z", "numtheory" => { "boring" => 0, "perfection" => [ bless( { "_file" => "(eval 164)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('6')->beq($got); }, "name" => "Math::BigInt->new(\"6\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 165)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('28')->beq($got); }, "name" => "Math::BigInt->new(\"28\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 166)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('496')->beq($got); }, "name" => "Math::BigInt->new(\"496\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) ] } }; my $actual = from_toml($toml); is($actual, $expected1, 'example - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'example - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'example - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing; TOML-Tiny-0.20/t/toml-test/valid/newline-crlf.t0000644000175000017500000000243214770631453017632 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/newline-crlf.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "newline" => "crlf", "os" => "DOS" }; my $actual = from_toml($toml); is($actual, $expected1, 'newline-crlf - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'newline-crlf - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'newline-crlf - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/array/0000775000175000017500000000000014770631453016177 5ustar olafolafTOML-Tiny-0.20/t/toml-test/valid/array/nested-inline-table.t0000644000175000017500000000262514770631453022212 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/array/nested-inline-table.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "a" => [ { "b" => {} } ] }; my $actual = from_toml($toml); is($actual, $expected1, 'array/nested-inline-table - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'array/nested-inline-table - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'array/nested-inline-table - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/array/string-quote-comma.t0000644000175000017500000000264514770631453022124 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/array/string-quote-comma.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "title" => [ "Client: \"XXXX\", Job: XXXX", "Code: XXXX" ] }; my $actual = from_toml($toml); is($actual, $expected1, 'array/string-quote-comma - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'array/string-quote-comma - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'array/string-quote-comma - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/array/mixed-int-float.toml0000644000175000017500000000003314770631453022067 0ustar olafolafints-and-floats = [1, 1.1] TOML-Tiny-0.20/t/toml-test/valid/array/mixed-string-table.t0000644000175000017500000000324614770631453022066 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/array/mixed-string-table.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "contributors" => [ "Foo Bar ", { "email" => "bazqux\@example.com", "name" => "Baz Qux", "url" => "https://example.com/bazqux" } ] }; my $actual = from_toml($toml); is($actual, $expected1, 'array/mixed-string-table - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'array/mixed-string-table - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'array/mixed-string-table - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/array/array.t0000644000175000017500000002615414770631453017510 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/array/array.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "comments" => [ bless( { "_file" => "(eval 116)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 117)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('2')->beq($got); }, "name" => "Math::BigInt->new(\"2\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) ], "dates" => [ "1987-07-05T17:45:00Z", "1979-05-27T07:32:00Z", "2006-06-01T11:00:00Z" ], "floats" => [ bless( { "_file" => "(eval 118)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('1.1')->beq($got); }, "name" => "Math::BigFloat->new(\"1.1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 119)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('2.1')->beq($got); }, "name" => "Math::BigFloat->new(\"2.1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 120)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('3.1')->beq($got); }, "name" => "Math::BigFloat->new(\"3.1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) ], "ints" => [ bless( { "_file" => "(eval 48)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 114)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('2')->beq($got); }, "name" => "Math::BigInt->new(\"2\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 115)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('3')->beq($got); }, "name" => "Math::BigInt->new(\"3\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) ], "strings" => [ "a", "b", "c" ] }; my $actual = from_toml($toml); is($actual, $expected1, 'array/array - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'array/array - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'array/array - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/array/empty.t0000644000175000017500000000300414770631453017515 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/array/empty.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "thevoid" => [ [ [ [ [] ] ] ] ] }; my $actual = from_toml($toml); is($actual, $expected1, 'array/empty - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'array/empty - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'array/empty - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/array/hetergeneous.t0000644000175000017500000001446614770631453021072 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/array/hetergeneous.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "mixed" => [ [ bless( { "_file" => "(eval 139)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 140)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('2')->beq($got); }, "name" => "Math::BigInt->new(\"2\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) ], [ "a", "b" ], [ bless( { "_file" => "(eval 141)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('1.1')->beq($got); }, "name" => "Math::BigFloat->new(\"1.1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 142)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('2.1')->beq($got); }, "name" => "Math::BigFloat->new(\"2.1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) ] ] }; my $actual = from_toml($toml); is($actual, $expected1, 'array/hetergeneous - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'array/hetergeneous - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'array/hetergeneous - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/array/bool.t0000644000175000017500000000246614770631453017325 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/array/bool.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "a" => [ 1, 0 ] }; my $actual = from_toml($toml); is($actual, $expected1, 'array/bool - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'array/bool - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'array/bool - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/array/string-quote-comma-2.t0000644000175000017500000000255514770631453022263 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/array/string-quote-comma-2.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "title" => [ " \", " ] }; my $actual = from_toml($toml); is($actual, $expected1, 'array/string-quote-comma-2 - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'array/string-quote-comma-2 - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'array/string-quote-comma-2 - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/array/table-array-string-backslash.toml0000644000175000017500000000003714770631453024532 0ustar olafolaffoo = [ { bar="\"{{baz}}\""} ] TOML-Tiny-0.20/t/toml-test/valid/array/nested-double.toml0000644000175000017500000000005014770631453021617 0ustar olafolafnest = [ [ ["a"], [1, 2, [3]] ] ] TOML-Tiny-0.20/t/toml-test/valid/array/mixed-int-string.t0000644000175000017500000000532514770631453021571 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/array/mixed-int-string.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "strings-and-ints" => [ "hi", bless( { "_file" => "(eval 146)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('42')->beq($got); }, "name" => "Math::BigInt->new(\"42\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) ] }; my $actual = from_toml($toml); is($actual, $expected1, 'array/mixed-int-string - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'array/mixed-int-string - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'array/mixed-int-string - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/array/table-array-string-backslash.t0000644000175000017500000000272014770631453024023 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/array/table-array-string-backslash.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "foo" => [ { "bar" => "\"{{baz}}\"" } ] }; my $actual = from_toml($toml); is($actual, $expected1, 'array/table-array-string-backslash - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'array/table-array-string-backslash - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'array/table-array-string-backslash - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/array/mixed-string-table.toml0000644000175000017500000000021314770631453022565 0ustar olafolafcontributors = [ "Foo Bar ", { name = "Baz Qux", email = "bazqux@example.com", url = "https://example.com/bazqux" } ] TOML-Tiny-0.20/t/toml-test/valid/array/nested-double.t0000644000175000017500000001233014770631453021113 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/array/nested-double.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "nest" => [ [ [ "a" ], [ bless( { "_file" => "(eval 147)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 148)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('2')->beq($got); }, "name" => "Math::BigInt->new(\"2\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), [ bless( { "_file" => "(eval 149)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('3')->beq($got); }, "name" => "Math::BigInt->new(\"3\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) ] ] ] ] }; my $actual = from_toml($toml); is($actual, $expected1, 'array/nested-double - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'array/nested-double - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'array/nested-double - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/array/string-quote-comma.toml0000644000175000017500000000007014770631453022622 0ustar olafolaftitle = [ "Client: \"XXXX\", Job: XXXX", "Code: XXXX" ] TOML-Tiny-0.20/t/toml-test/valid/array/nested-inline-table.toml0000644000175000017500000000002314770631453022710 0ustar olafolafa = [ { b = {} } ] TOML-Tiny-0.20/t/toml-test/valid/array/array.toml0000644000175000017500000000031514770631453020207 0ustar olafolafints = [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 ] TOML-Tiny-0.20/t/toml-test/valid/array/empty.toml0000644000175000017500000000002514770631453020225 0ustar olafolafthevoid = [[[[[]]]]] TOML-Tiny-0.20/t/toml-test/valid/array/nospaces.toml0000644000175000017500000000001714770631453020703 0ustar olafolafints = [1,2,3] TOML-Tiny-0.20/t/toml-test/valid/array/strings.toml0000644000175000017500000000010314770631453020555 0ustar olafolafstring_array = [ "all", 'strings', """are the same""", '''type'''] TOML-Tiny-0.20/t/toml-test/valid/array/bool.toml0000644000175000017500000000002214770631453020017 0ustar olafolafa = [true, false] TOML-Tiny-0.20/t/toml-test/valid/array/hetergeneous.toml0000644000175000017500000000005114770631453021563 0ustar olafolafmixed = [[1, 2], ["a", "b"], [1.1, 2.1]] TOML-Tiny-0.20/t/toml-test/valid/array/nested.toml0000644000175000017500000000002614770631453020352 0ustar olafolafnest = [["a"], ["b"]] TOML-Tiny-0.20/t/toml-test/valid/array/mixed-int-array.t0000644000175000017500000000544314770631453021402 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/array/mixed-int-array.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "arrays-and-ints" => [ bless( { "_file" => "(eval 143)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), [ "Arrays are not integers." ] ] }; my $actual = from_toml($toml); is($actual, $expected1, 'array/mixed-int-array - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'array/mixed-int-array - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'array/mixed-int-array - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/array/mixed-int-string.toml0000644000175000017500000000003614770631453022273 0ustar olafolafstrings-and-ints = ["hi", 42] TOML-Tiny-0.20/t/toml-test/valid/array/string-with-comma.toml0000644000175000017500000000006414770631453022443 0ustar olafolaftitle = [ "Client: XXXX, Job: XXXX", "Code: XXXX" ] TOML-Tiny-0.20/t/toml-test/valid/array/mixed-int-float.t0000644000175000017500000000774214770631453021375 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/array/mixed-int-float.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "ints-and-floats" => [ bless( { "_file" => "(eval 144)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 145)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('1.1')->beq($got); }, "name" => "Math::BigFloat->new(\"1.1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) ] }; my $actual = from_toml($toml); is($actual, $expected1, 'array/mixed-int-float - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'array/mixed-int-float - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'array/mixed-int-float - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/array/nested.t0000644000175000017500000000270614770631453017651 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/array/nested.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "nest" => [ [ "a" ], [ "b" ] ] }; my $actual = from_toml($toml); is($actual, $expected1, 'array/nested - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'array/nested - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'array/nested - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/array/mixed-int-array.toml0000644000175000017500000000006514770631453022105 0ustar olafolafarrays-and-ints = [1, ["Arrays are not integers."]] TOML-Tiny-0.20/t/toml-test/valid/array/nospaces.t0000644000175000017500000001127214770631453020200 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/array/nospaces.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "ints" => [ bless( { "_file" => "(eval 150)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 151)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('2')->beq($got); }, "name" => "Math::BigInt->new(\"2\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), bless( { "_file" => "(eval 152)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('3')->beq($got); }, "name" => "Math::BigInt->new(\"3\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) ] }; my $actual = from_toml($toml); is($actual, $expected1, 'array/nospaces - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'array/nospaces - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'array/nospaces - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/array/strings.t0000644000175000017500000000273014770631453020055 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/array/strings.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "string_array" => [ "all", "strings", "are the same", "type" ] }; my $actual = from_toml($toml); is($actual, $expected1, 'array/strings - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'array/strings - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'array/strings - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/array/string-quote-comma-2.toml0000644000175000017500000000002414770631453022760 0ustar olafolaftitle = [ " \", ",] TOML-Tiny-0.20/t/toml-test/valid/array/string-with-comma.t0000644000175000017500000000263514770631453021741 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/array/string-with-comma.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "title" => [ "Client: XXXX, Job: XXXX", "Code: XXXX" ] }; my $actual = from_toml($toml); is($actual, $expected1, 'array/string-with-comma - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'array/string-with-comma - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'array/string-with-comma - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/key/0000775000175000017500000000000014770631453015651 5ustar olafolafTOML-Tiny-0.20/t/toml-test/valid/key/space.t0000644000175000017500000000444514770631453017136 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/key/space.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "a b" => bless( { "_file" => "(eval 290)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }; my $actual = from_toml($toml); is($actual, $expected1, 'key/space - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'key/space - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'key/space - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/key/quoted-dots.toml0000644000175000017500000000016014770631453021011 0ustar olafolafplain = 1 "with.dot" = 2 [plain_table] plain = 3 "with.dot" = 4 [table.withdot] plain = 5 "key.with.dots" = 6 TOML-Tiny-0.20/t/toml-test/valid/key/dotted.t0000644000175000017500000007027414770631453017331 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/key/dotted.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "a" => { "few" => { "dots" => { "polka" => { "dance-with" => "Dot", "dot" => "again?" } } } }, "arr" => [ { "a" => { "b" => { "c" => bless( { "_file" => "(eval 263)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "d" => bless( { "_file" => "(eval 264)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('2')->beq($got); }, "name" => "Math::BigInt->new(\"2\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } } }, { "a" => { "b" => { "c" => bless( { "_file" => "(eval 266)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('3')->beq($got); }, "name" => "Math::BigInt->new(\"3\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "d" => bless( { "_file" => "(eval 265)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('4')->beq($got); }, "name" => "Math::BigInt->new(\"4\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } } } ], "count" => { "a" => bless( { "_file" => "(eval 274)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "b" => bless( { "_file" => "(eval 275)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('2')->beq($got); }, "name" => "Math::BigInt->new(\"2\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "c" => bless( { "_file" => "(eval 270)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('3')->beq($got); }, "name" => "Math::BigInt->new(\"3\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "d" => bless( { "_file" => "(eval 271)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('4')->beq($got); }, "name" => "Math::BigInt->new(\"4\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "e" => bless( { "_file" => "(eval 278)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('5')->beq($got); }, "name" => "Math::BigInt->new(\"5\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "f" => bless( { "_file" => "(eval 276)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('6')->beq($got); }, "name" => "Math::BigInt->new(\"6\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "g" => bless( { "_file" => "(eval 279)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('7')->beq($got); }, "name" => "Math::BigInt->new(\"7\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "h" => bless( { "_file" => "(eval 277)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('8')->beq($got); }, "name" => "Math::BigInt->new(\"8\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "i" => bless( { "_file" => "(eval 272)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('9')->beq($got); }, "name" => "Math::BigInt->new(\"9\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "j" => bless( { "_file" => "(eval 273)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('10')->beq($got); }, "name" => "Math::BigInt->new(\"10\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "k" => bless( { "_file" => "(eval 280)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('11')->beq($got); }, "name" => "Math::BigInt->new(\"11\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "l" => bless( { "_file" => "(eval 269)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('12')->beq($got); }, "name" => "Math::BigInt->new(\"12\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }, "many" => { "dots" => { "here" => { "dot" => { "dot" => { "dot" => bless( { "_file" => "(eval 268)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('42')->beq($got); }, "name" => "Math::BigInt->new(\"42\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } } } } }, "name" => { "first" => "Arthur", "last" => "Dent" }, "tbl" => { "a" => { "b" => { "c" => bless( { "_file" => "(eval 267)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigFloat; my $got = 'Math::BigFloat'->new($_); 'Math::BigFloat'->new('42.666')->beq($got); }, "name" => "Math::BigFloat->new(\"42.666\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } } } }; my $actual = from_toml($toml); is($actual, $expected1, 'key/dotted - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'key/dotted - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'key/dotted - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/key/case-sensitive.t0000644000175000017500000000344314770631453020762 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/key/case-sensitive.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "Section" => { "M" => "latin letter M", "name" => "different section!!", "\x{39c}" => "greek capital letter MU", "\x{3bc}" => "greek small letter mu" }, "sectioN" => "NN", "section" => { "NAME" => "upper", "Name" => "capitalized", "name" => "lower" } }; my $actual = from_toml($toml); is($actual, $expected1, 'key/case-sensitive - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'key/case-sensitive - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'key/case-sensitive - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/key/empty.t0000644000175000017500000000235214770631453017174 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/key/empty.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "" => "blank" }; my $actual = from_toml($toml); is($actual, $expected1, 'key/empty - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'key/empty - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'key/empty - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/key/escapes.toml0000644000175000017500000000022514770631453020166 0ustar olafolaf"\n" = "newline" "\u00c0" = "latin capital letter A with grave" "\"" = "just a quote" ["backsp\b\b"] ["\"quoted\""] quote = true ["a.b"."\u00c0"] TOML-Tiny-0.20/t/toml-test/valid/key/numeric.toml0000644000175000017500000000000614770631453020202 0ustar olafolaf1 = 1 TOML-Tiny-0.20/t/toml-test/valid/key/equals-nospace.toml0000644000175000017500000000001214770631453021455 0ustar olafolafanswer=42 TOML-Tiny-0.20/t/toml-test/valid/key/alphanum.toml0000644000175000017500000000025514770631453020353 0ustar olafolafalpha = "a" 123 = "num" 000111 = "leading" 10e3 = "false float" one1two2 = "mixed" with-dash = "dashed" under_score = "___" 34-11 = 23 [2018_10] 001 = 1 [a-a-a] _ = false TOML-Tiny-0.20/t/toml-test/valid/key/quoted-dots.t0000644000175000017500000002370414770631453020312 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/key/quoted-dots.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "plain" => bless( { "_file" => "(eval 289)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "plain_table" => { "plain" => bless( { "_file" => "(eval 287)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('3')->beq($got); }, "name" => "Math::BigInt->new(\"3\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "with.dot" => bless( { "_file" => "(eval 288)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('4')->beq($got); }, "name" => "Math::BigInt->new(\"4\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }, "table" => { "withdot" => { "key.with.dots" => bless( { "_file" => "(eval 285)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('6')->beq($got); }, "name" => "Math::BigInt->new(\"6\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "plain" => bless( { "_file" => "(eval 286)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('5')->beq($got); }, "name" => "Math::BigInt->new(\"5\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } }, "with.dot" => bless( { "_file" => "(eval 284)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('2')->beq($got); }, "name" => "Math::BigInt->new(\"2\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }; my $actual = from_toml($toml); is($actual, $expected1, 'key/quoted-dots - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'key/quoted-dots - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'key/quoted-dots - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/key/alphanum.t0000644000175000017500000001011014770631453017632 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/key/alphanum.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "000111" => "leading", "10e3" => "false float", "123" => "num", "2018_10" => { "001" => bless( { "_file" => "(eval 262)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }, "34-11" => bless( { "_file" => "(eval 261)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('23')->beq($got); }, "name" => "Math::BigInt->new(\"23\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "a-a-a" => { "_" => 0 }, "alpha" => "a", "one1two2" => "mixed", "under_score" => "___", "with-dash" => "dashed" }; my $actual = from_toml($toml); is($actual, $expected1, 'key/alphanum - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'key/alphanum - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'key/alphanum - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/key/numeric-dotted.t0000644000175000017500000000476014770631453020766 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/key/numeric-dotted.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "1" => { "2" => bless( { "_file" => "(eval 283)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('3')->beq($got); }, "name" => "Math::BigInt->new(\"3\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) } }; my $actual = from_toml($toml); is($actual, $expected1, 'key/numeric-dotted - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'key/numeric-dotted - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'key/numeric-dotted - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/key/empty.toml0000644000175000017500000000001514770631453017676 0ustar olafolaf"" = "blank" TOML-Tiny-0.20/t/toml-test/valid/key/numeric-dotted.toml0000644000175000017500000000001014770631453021456 0ustar olafolaf1.2 = 3 TOML-Tiny-0.20/t/toml-test/valid/key/special-chars.toml0000644000175000017500000000005214770631453021257 0ustar olafolaf"~!@$^&*()_+-`1234567890[]|/?><.,;:'" = 1 TOML-Tiny-0.20/t/toml-test/valid/key/space.toml0000644000175000017500000000001214770631453017630 0ustar olafolaf"a b" = 1 TOML-Tiny-0.20/t/toml-test/valid/key/numeric.t0000644000175000017500000000441314770631453017500 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/key/numeric.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "1" => bless( { "_file" => "(eval 282)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }; my $actual = from_toml($toml); is($actual, $expected1, 'key/numeric - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'key/numeric - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'key/numeric - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/key/special-word.toml0000644000175000017500000000011114770631453021126 0ustar olafolaffalse = false true = 1 inf = 100000000 nan = "ceci n'est pas un nombre" TOML-Tiny-0.20/t/toml-test/valid/key/dotted.toml0000644000175000017500000000102714770631453020027 0ustar olafolaf# Note: this file contains literal tab characters. name.first = "Arthur" "name".'last' = "Dent" many.dots.here.dot.dot.dot = 42 # Space are ignored, and key parts can be quoted. count.a = 1 count . b = 2 "count"."c" = 3 "count" . "d" = 4 'count'.'e' = 5 'count' . 'f' = 6 "count".'g' = 7 "count" . 'h' = 8 count.'i' = 9 count . 'j' = 10 "count".k = 11 "count" . l = 12 [tbl] a.b.c = 42.666 [a.few.dots] polka.dot = "again?" polka.dance-with = "Dot" [[arr]] a.b.c=1 a.b.d=2 [[arr]] a.b.c=3 a.b.d=4 TOML-Tiny-0.20/t/toml-test/valid/key/escapes.t0000644000175000017500000000311714770631453017461 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/key/escapes.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "\n" => "newline", "\"" => "just a quote", "\"quoted\"" => { "quote" => 1 }, "a.b" => { "\x{c0}" => {} }, "backsp\b\b" => {}, "\x{c0}" => "latin capital letter A with grave" }; my $actual = from_toml($toml); is($actual, $expected1, 'key/escapes - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'key/escapes - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'key/escapes - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/key/special-chars.t0000644000175000017500000000560714770631453020562 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/key/special-chars.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "~!\@\$^&*()_+-`1234567890[]|/?><.,;:'" => bless( { "_file" => "(eval 291)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }; my $actual = from_toml($toml); is($actual, $expected1, 'key/special-chars - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'key/special-chars - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'key/special-chars - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/key/special-word.t0000644000175000017500000000701414770631453020427 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/key/special-word.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "false" => 0, "inf" => bless( { "_file" => "(eval 292)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('100000000')->beq($got); }, "name" => "Math::BigInt->new(\"100000000\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ), "nan" => "ceci n'est pas un nombre", "true" => bless( { "_file" => "(eval 293)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('1')->beq($got); }, "name" => "Math::BigInt->new(\"1\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }; my $actual = from_toml($toml); is($actual, $expected1, 'key/special-word - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'key/special-word - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'key/special-word - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/key/equals-nospace.t0000644000175000017500000000457614770631453020770 0ustar olafolaf# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/key/equals-nospace.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "answer" => bless( { "_file" => "(eval 281)", "_lines" => [ 7 ], "code" => sub { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x05\x04\x50"} use strict; no feature ':all'; use feature ':5.16'; require Math::BigInt; my $got = 'Math::BigInt'->new($_); 'Math::BigInt'->new('42')->beq($got); }, "name" => "Math::BigInt->new(\"42\")->beq(\$_)", "operator" => "CODE(...)" }, 'Test2::Compare::Custom' ) }; my $actual = from_toml($toml); is($actual, $expected1, 'key/equals-nospace - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'key/equals-nospace - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'key/equals-nospace - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; done_testing;TOML-Tiny-0.20/t/toml-test/valid/key/case-sensitive.toml0000644000175000017500000000031314770631453021463 0ustar olafolafsectioN = "NN" [section] name = "lower" NAME = "upper" Name = "capitalized" [Section] name = "different section!!" "μ" = "greek small letter mu" "Μ" = "greek capital letter MU" M = "latin letter M" TOML-Tiny-0.20/t/numbers.t0000644000175000017500000001011714770631453013670 0ustar olafolafuse strict; use warnings; use Test2::V0; use TOML::Tiny; require Math::BigInt; require Math::BigFloat; subtest 'integers' => sub{ subtest 'decimal' => sub{ is from_toml('x=42'), {x => 42}, 'positive'; is from_toml('x=-42'), {x => -42}, 'negative'; is from_toml('x=42_42'), {x => 4242}, 'underscores'; is from_toml('x=9223372036854775807'), hash{ field x => validator(sub{ my %params = @_; Math::BigInt->new('9223372036854775807')->beq($params{got}); }); end; }, 'positive bignum'; is from_toml('x=-9223372036854775808'), hash{ field x => validator(sub{ my %params = @_; Math::BigInt->new('-9223372036854775808')->beq($params{got}); }); end; }, 'negative bignum'; }; subtest 'hexadecimal' => sub{ is from_toml('x=0xDEADBEEF'), {x => 0xDEADBEEF}, 'all caps'; is from_toml('x=0xdeadbeef'), {x => 0xDEADBEEF}, 'all lower'; is from_toml('x=0xDeAdBeEf'), {x => 0xDEADBEEF}, 'mixed caps'; is from_toml('x=0xDEAD_BEEF'), {x => 0xDEADBEEF}, 'underscores'; is from_toml('x=0xDEADBEEF '), {x => 0xDEADBEEF}, 'trailing space'; is from_toml('x=0x7fffffffffffffff'), hash{ field x => validator(sub{ my %params = @_; Math::BigInt->new('0x7fffffffffffffff')->beq($params{got}); }); end; }, 'bignum'; }; subtest 'binary' => sub{ is from_toml('x=0b1010'), {x => 0b1010}, 'binary'; is from_toml('x=0b10_10'), {x => 0b1010}, 'underscores'; is from_toml('x=0o777777777777777777777'), hash{ field x => validator(sub{ my %params = @_; Math::BigInt->from_oct('0777777777777777777777')->beq($params{got}); }); end; }, 'bignum'; }; subtest 'octal' => sub{ is from_toml('x=0o755'), {x => 0755}, 'octal'; is from_toml('x=0o7_55'), {x => 0755}, 'underscores'; is from_toml('x=0b111111111111111111111111111111111111111111111111111111111111111'), hash{ field x => validator(sub{ my %params = @_; Math::BigInt->new('0b111111111111111111111111111111111111111111111111111111111111111')->beq($params{got}); }); end; }, 'bignum'; }; }; subtest 'floats' => sub{ is from_toml('x=4.2'), {x => 4.2}, '4.2'; is from_toml('x=+4.2'), {x => 4.2}, '+4.2'; is from_toml('x=-4.2'), {x => -4.2}, '-4.2'; is from_toml('x=0.42'), {x => 0.42}, '0.42'; is from_toml('x=+0.42'), {x => 0.42}, '+0.42'; is from_toml('x=-0.42'), {x => -0.42}, '-0.42'; subtest 'exponent w/ lowercase e' => sub{ is from_toml('x=4.2e3'), {x => 4.2e3}, '4.2e3'; is from_toml('x=-4.2e3'), {x => -4.2e3}, '-4.2e3'; is from_toml('x=4.2e-3'), {x => 4.2e-3}, '4.2e-3'; is from_toml('x=-4.2e-3'), {x => -4.2e-3}, '-4.2e-3'; }; subtest 'exponent w/ uppercase e' => sub{ is from_toml('x=4.2E3'), {x => 4.2e3}, '4.2E3'; is from_toml('x=-4.2E3'), {x => -4.2e3}, '-4.2E3'; is from_toml('x=4.2E-3'), {x => 4.2e-3}, '4.2E-3'; is from_toml('x=-4.2E-3'), {x => -4.2e-3}, '-4.2E-3'; }; is from_toml('x=inf'), {x => 'inf'}, 'inf'; is from_toml('x=+inf'), {x => 'inf'}, '+inf'; is from_toml('x=-inf'), {x => -'inf'}, '-inf'; for (qw(nan +nan -nan)) { is from_toml("x=$_"), hash{ field x => 'NaN'; end; }, $_; } is from_toml('x=nan'), {x => 'NaN'}, 'nan'; is from_toml('x=+nan'), {x => 'NaN'}, '+nan'; is from_toml('x=-nan'), {x => 'NaN'}, '-nan'; is from_toml('x=42_42.42_42'), {x => 4242.4242}, 'underscores'; }; #------------------------------------------------------------------------------- # Ensure that numbers survive the trip through to_toml(from_toml(...)) and are # not coerced into strings by perl. #------------------------------------------------------------------------------- subtest 'round trip preserves numerical values' => sub{ is to_toml(scalar from_toml('port=1234')), 'port=1234', 'integers'; is to_toml(scalar from_toml('pi=3.14')), 'pi=3.14', 'floats'; is to_toml(scalar from_toml('nan=nan')), 'nan=nan', 'nan'; is to_toml(scalar from_toml('pos=inf')), 'pos=inf', 'inf'; is to_toml(scalar from_toml('neg=-inf')), 'neg=-inf', '-inf'; }; done_testing; TOML-Tiny-0.20/t/parser.t0000644000175000017500000000364014770631453013514 0ustar olafolafuse strict; use warnings; use Data::Dumper; use Test2::V0; use TOML::Tiny; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; subtest 'oddballs and regressions' => sub{ subtest 'strings that look like numbers' => sub{ my $parser = TOML::Tiny->new( inflate_integer => sub{ use Math::BigInt; Math::BigInt->new(shift); }, inflate_float => sub{ use Math::BigFloat; Math::BigFloat->new(shift); } ); my $data = $parser->decode(q{ not_an_int = "42" is_an_int = 42 not_a_flt = "4.2" is_a_flt = 4.2 }); ok !ref($data->{not_an_int}), 'strings do not inflate as integers'; ok ref($data->{is_an_int}) && $data->{is_an_int}->isa('Math::BigInt'), 'integers do inflate with inflate_integer'; ok !ref($data->{not_a_flt}), 'strings do not inflate as floats'; ok ref($data->{is_a_flt}) && $data->{is_a_flt}->isa('Math::BigFloat'), 'floats do inflate with inflate_float'; }; subtest 'no dequoting of raw string keys' => sub { my $funky_string = "a \\\\ \\x42 b \\\""; my $toml = <(); diag $error; }; my $diag = sub { }; ok $data->{key}{$funky_string} eq 'a', "key.funky" and ok $data->{itable}{$funky_string} eq 'b', "not in inline table" and ok $data->{table}{$funky_string}{x} eq 'c', "not in table heading" and ok $data->{array}{$funky_string}[0]{y} eq 'd', "not in array item heading" or do { $diag1->(); diag ''; diag 'PARSED AS'; diag Dumper($data); } }; }; done_testing; TOML-Tiny-0.20/t/faithful.t0000644000175000017500000000232014770631453014014 0ustar olafolafuse utf8; use Test2::V0; use Data::Dumper; use DateTime::Format::ISO8601; use TOML::Tiny; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; my $input = q{ datetime=2020-05-04T16:37:02.905408062+01:00 datetimes="2020-05-04T16:37:02.905408062+01:00" float=3.14 floats="3.14" uint=3 uints="3" nint=-4 nints="-4" bigint=1852528528562625752750 bigints="1852528528562625752750" hex=0x12 oct=0o751 bin=0b11010110 boolf=false boolt=true boolfs="false" boolts="true" dtlocal=1979-05-27T00:32:00.643144312 dtlocals="1979-05-27T00:32:00.643144312" }; sub norm ($) { join "\n", ( sort map { s{=0o(\d+)$}{ '='.oct($1) }e; s{=(0[xb]\w+)$}{ '='.eval($1) }e; $_; } grep /./, split /\n/, $_[0] ), '' } my $coder = TOML::Tiny->new( no_string_guessing => 1, inflate_datetime => sub { # RFC3339 bombs out if there is no timezone, so we parse with 8601 DateTime::Format::ISO8601->parse_datetime(shift) }, ); my $parsed = $coder->decode($input); my $actual = norm($coder->encode($parsed)); my $expected = norm($input); is($actual, $expected, 'round trip') or do{ diag 'EXPECTED:'; diag Dumper($expected); diag 'ACTUAL:'; diag Dumper($actual); }; done_testing; TOML-Tiny-0.20/t/00-report-prereqs.dd0000644000175000017500000000353514770631453015556 0ustar olafolafdo { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '0' } }, 'develop' => { 'requires' => { 'Test::Pod' => '1.41' } }, 'runtime' => { 'recommends' => { 'Types::Serialiser' => '0' }, 'requires' => { 'Carp' => '0', 'Data::Dumper' => '0', 'Encode' => '0', 'Exporter' => '0', 'Math::BigInt' => '1.999718', 'perl' => '5.018' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900', 'Unicode::GCString' => '0' }, 'requires' => { 'Data::Dumper' => '0', 'DateTime::Format::ISO8601' => '0', 'DateTime::Format::RFC3339' => '0', 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'TOML::Parser' => '0', 'Test2::V0' => '0', 'Test::More' => '0', 'Test::Pod' => '0' } } }; $x; }TOML-Tiny-0.20/t/writer.t0000644000175000017500000001063514770631453013536 0ustar olafolafuse strict; use warnings; use DateTime (); use Test2::V0; use TOML::Tiny qw(from_toml to_toml); use TOML::Tiny::Writer (); my $src = do{ local $/; }; subtest basics => sub{ my $data = from_toml($src); my $toml = to_toml($data); my $got = from_toml($toml); is $got, $data, 'to_toml <=> from_toml'; }; #------------------------------------------------------------------------------- # Adapted from DateTime::Format::RFC3339. #------------------------------------------------------------------------------- subtest 'rfc3339 datetimes' => sub{ my $dt; $dt = DateTime->new(year => 2002, month => 7, day => 1, hour => 13, minute => 50, second => 5, time_zone => 'UTC'); is TOML::Tiny::Writer::strftime_rfc3339($dt), '2002-07-01T13:50:05Z', 'UTC'; $dt = DateTime->new(year => 2002, month => 7, day => 1, hour => 13, minute => 50, second => 5, time_zone => 'Europe/London'); is TOML::Tiny::Writer::strftime_rfc3339($dt), '2002-07-01T13:50:05+01:00', 'positive offset'; $dt = DateTime->new(year => 2002, month => 1, day => 1, hour => 13, minute => 50, second => 5, time_zone => 'Europe/London'); is TOML::Tiny::Writer::strftime_rfc3339($dt), '2002-01-01T13:50:05+00:00', 'zero offset'; $dt = DateTime->new(year => 2002, month => 1, day => 1, hour => 13, minute => 50, second => 5, time_zone => 'America/New_York'); is TOML::Tiny::Writer::strftime_rfc3339($dt), '2002-01-01T13:50:05-05:00', 'negative offset'; $dt = DateTime->new(year => 1880, month => 1, day => 1, hour => 0, minute => 0, second => 0, time_zone => 'America/New_York'); is TOML::Tiny::Writer::strftime_rfc3339($dt), '1880-01-01T04:56:02Z', 'offset with non-integral minutes'; $dt = DateTime->new(year => 2002, month => 1, day => 1, hour => 13, minute => 50, second => 5, time_zone => 'floating'); is TOML::Tiny::Writer::strftime_rfc3339($dt), '2002-01-01T13:50:05', 'floating time zone'; }; subtest 'oddballs and regressions' => sub{ subtest 'strings that look like numbers' => sub{ my $data = { is_inf => 'inf', not_inf => 'to infinity and beyond', is_nan => 'nan', not_nan => 'no nan here', }; is to_toml({a => 'no inf here'}), 'a="no inf here"', '"inf" present in string is string'; is to_toml({a => 'no nan here'}), 'a="no nan here"', '"nan" present in string is string'; }; subtest 'strings that contain DateTime but are not DateTime' => sub { my $data = { not_a_dt => 'Not a 2024-05-31T17:08:44', }; is to_toml( $data ), 'not_a_dt="Not a 2024-05-31T17:08:44"', $data->{not_a_dt}; }; subtest 'values which are undefined' => sub { my $data = { deep => { in => { an => [ undef ] } } }; eval { to_toml( $data ) }; like $@, qr/found undefined value/; }; subtest 'quoted inline table keys' => sub { my $data = { q{foo} => [ q{bar}, { q{<=} => 33 } ] } ; my $encoded = to_toml( $data ); my $decoded; ok( lives { $decoded = from_toml( $encoded ) }, 'decode succeeded' ) or note $@; is ( $decoded, $data, 'round trip successful' ); }; subtest 'encoding a non-hashref' => sub { eval { to_toml( q{} ) }; like $@, qr/must be a hashref/, 'scalar'; eval { to_toml( [] ) }; like $@, qr/must be a hashref/, 'array'; }; }; subtest 'to_toml_array' => sub{ my @to_toml = [1,2,3]; my $toml = TOML::Tiny::Writer::to_toml_array(\@to_toml, {strict => 1}); ok($toml, 'no exception in strict mode'); }; done_testing; __DATA__ # This is a TOML document. title = "TOML Example" hetero_array = ["life", "universe", "everything", 42] [owner] name = "Tom Preston-Werner" dob = 1979-05-27T07:32:00-08:00 # First class dates [database] server = "192.168.1.1" ports = [ 8001, 8001, 8002 ] connection_max = 5000 enabled = true options = {"quote-keys"=false} [servers] # Indentation (tabs and/or spaces) is allowed but not required [servers.alpha] ip = "10.0.0.1" dc = "eqdc10" [servers.beta] ip = "10.0.0.2" dc = "eqdc10" [clients] data = [ ["gamma", "delta"], [1, 2] ] # Line breaks are OK when inside arrays hosts = [ "alpha", "omega" ] [cfg."something with a 'single-quote'".nested] inner = "forty-one" [cfg.'something with a "double-quote"'.nested] inner = "forty-two" [cfg."something with a 'single-quote' and a \"double-quote\"".nested] inner = "forty-three" [[products]] name = "Hammer" sku = 738594937 [[products]] [[products]] name = "Nail" sku = 284758393 color = "gray" TOML-Tiny-0.20/t/author-pod-syntax.t0000644000175000017500000000045414770631453015626 0ustar olafolaf#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); TOML-Tiny-0.20/t/strict_arrays.t0000644000175000017500000000044414770631453015110 0ustar olafolafuse strict; use warnings; use Test2::V0; use TOML::Tiny; my $tt = TOML::Tiny->new(strict_arrays => 1); subtest 'string containing int recognized as type=integer' => sub{ my $toml = q{ [test] array = ["u", "u2"] }; ok lives{ $tt->decode($toml) }, 'parse succeeds'; }; done_testing; TOML-Tiny-0.20/t/parity.t0000644000175000017500000000430614770631453013530 0ustar olafolaf#------------------------------------------------------------------------------- # Tests the results of parsing the example TOML from # https://github.com/toml-lang/toml against the de facto standard TOML module # on CPAN. Includes the array-of-tables example as well since that is not # represented in the synopsis example #------------------------------------------------------------------------------- use Test2::V0; use Data::Dumper; use TOML::Tiny::Parser; my $toml = do{ local $/; }; subtest 'TOML::Parser' => sub{ use TOML::Parser; subtest 'defaults' => sub{ my $exp = TOML::Parser->new->parse($toml); my $got = TOML::Tiny::Parser->new->parse($toml); is $got, $exp, 'equivalence' or diag Dumper({got => $got, expected => $exp}); }; subtest 'inflate_boolean' => sub{ my $inflate = sub{ shift eq 'true' ? 'yes' : 'no' }; my $exp = TOML::Parser->new(inflate_boolean => $inflate)->parse($toml); my $got = TOML::Tiny::Parser->new(inflate_boolean => $inflate)->parse($toml); is $got, $exp, 'equivalence' or diag Dumper({got => $got, expected => $exp}); }; subtest 'inflate_datetime' => sub{ require DateTime::Format::RFC3339; my $inflate = sub{ DateTime::Format::RFC3339->parse_datetime(shift) }; my $exp = TOML::Parser->new(inflate_datetime => $inflate)->parse($toml); my $got = TOML::Tiny::Parser->new(inflate_datetime => $inflate)->parse($toml); is $got, $exp, 'equivalence' or diag Dumper({got => $got, expected => $exp}); }; }; done_testing; __DATA__ # This is a TOML document. title = "TOML Example" [owner] name = "Tom Preston-Werner" dob = 1979-05-27T07:32:00-08:00 # First class dates [database] server = "192.168.1.1" ports = [ 8001, 8001, 8002 ] connection_max = 5000 enabled = true options = {"quote-keys"=false} [servers] # Indentation (tabs and/or spaces) is allowed but not required [servers.alpha] ip = "10.0.0.1" dc = "eqdc10" [servers.beta] ip = "10.0.0.2" dc = "eqdc10" [clients] data = [ ["gamma", "delta"], [1, 2] ] # Line breaks are OK when inside arrays hosts = [ "alpha", "omega" ] [[products]] name = "Hammer" sku = 738594937 [[products]] [[products]] name = "Nail" sku = 284758393 color = "gray" TOML-Tiny-0.20/t/00-report-prereqs.t0000644000175000017500000001360114770631453015425 0ustar olafolaf#!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.029 use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec; # from $version::LAX my $lax_version_re = qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? | (?:\.[0-9]+) (?:_[0-9]+)? ) | (?: v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? | (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? ) )/x; # hide optional CPAN::Meta modules from prereq scanner # and check if they are available my $cpan_meta = "CPAN::Meta"; my $cpan_meta_pre = "CPAN::Meta::Prereqs"; my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic # Verify requirements? my $DO_VERIFY_PREREQS = 1; sub _max { my $max = shift; $max = ( $_ > $max ) ? $_ : $max for @_; return $max; } sub _merge_prereqs { my ($collector, $prereqs) = @_; # CPAN::Meta::Prereqs object if (ref $collector eq $cpan_meta_pre) { return $collector->with_merged_prereqs( CPAN::Meta::Prereqs->new( $prereqs ) ); } # Raw hashrefs for my $phase ( keys %$prereqs ) { for my $type ( keys %{ $prereqs->{$phase} } ) { for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; } } } return $collector; } my @include = qw( ); my @exclude = qw( ); # Add static prereqs to the included modules list my $static_prereqs = do './t/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), $static_prereqs ); # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; my $cpan_meta_error; if ( $source && $HAS_CPAN_META && (my $meta = eval { CPAN::Meta->load_file($source) } ) ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } else { $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source) $source = 'static metadata'; } my @full_reports; my @dep_errors; my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; # Add static includes into a fake section for my $mod (@include) { $req_hash->{other}{modules}{$mod} = 0; } for my $phase ( qw(configure build test runtime develop other) ) { next unless $req_hash->{$phase}; next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); for my $type ( qw(requires recommends suggests conflicts modules) ) { next unless $req_hash->{$phase}{$type}; my $title = ucfirst($phase).' '.ucfirst($type); my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { next if grep { $_ eq $mod } @exclude; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; if ($mod eq 'perl') { push @reports, ['perl', $want, $]]; next; } my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; push @reports, [$mod, $want, $have]; if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { if ( $have !~ /\A$lax_version_re\z/ ) { push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; } elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { push @dep_errors, "$mod version '$have' is not in required range '$want'"; } } } else { push @reports, [$mod, $want, "missing"]; if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { push @dep_errors, "$mod is not installed ($req_string)"; } } } if ( @reports ) { push @full_reports, "=== $title ===\n\n"; my $ml = _max( map { length $_->[0] } @reports ); my $wl = _max( map { length $_->[1] } @reports ); my $hl = _max( map { length $_->[2] } @reports ); if ($type eq 'modules') { splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; } else { splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; } push @full_reports, "\n"; } } } if ( @full_reports ) { diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } if ( $cpan_meta_error || @dep_errors ) { diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n"; } if ( $cpan_meta_error ) { my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n"; } if ( @dep_errors ) { diag join("\n", "\nThe following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass('Reported prereqs'); # vim: ts=4 sts=4 sw=4 et: TOML-Tiny-0.20/LICENSE0000644000175000017500000004641614770631453012605 0ustar olafolafThis software is copyright (c) 2025 by Jeff Ober. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2025 by Jeff Ober. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Perl Artistic License 1.0 --- This software is Copyright (c) 2025 by Jeff Ober. This is free software, licensed under: The Perl Artistic License 1.0 The "Artistic License" Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder as specified below. "Copyright Holder" is whoever is named in the copyright or copyrights for the package. "You" is you, if you're thinking about copying or distributing this Package. "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as uunet.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) give non-standard executables non-standard names, and clearly document the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. You may embed this Package's interpreter within an executable of yours (by linking); this shall be construed as a mere form of aggregation, provided that the complete Standard Version of the interpreter is so embedded. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whoever generated them, and may be sold commercially, and may be aggregated with this Package. If such scripts or library files are aggregated with this Package via the so-called "undump" or "unexec" methods of producing a binary executable image, then distribution of such an image shall neither be construed as a distribution of this Package nor shall it fall under the restrictions of Paragraphs 3 and 4, provided that you do not represent such an executable image as a Standard Version of this Package. 7. C subroutines (or comparably compiled subroutines in other languages) supplied by you and linked into this Package in order to emulate subroutines and variables of the language defined by this Package shall not be considered part of this Package, but are the equivalent of input as in Paragraph 6, provided these subroutines do not change the language in any way that would cause it to fail the regression tests for the language. 8. Aggregation of this Package with a commercial distribution is always permitted provided that the use of this Package is embedded; that is, when no overt attempt is made to make this Package's interfaces visible to the end user of the commercial distribution. Such use shall not be construed as a distribution of this Package. 9. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End TOML-Tiny-0.20/MANIFEST0000644000175000017500000006036714770631453012732 0ustar olafolaf# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.032. Changes Dockerfile LICENSE MANIFEST MANIFEST.SKIP META.json META.yml Makefile.PL README cpanfile dist.ini lib/TOML/Tiny.pm lib/TOML/Tiny/Grammar.pm lib/TOML/Tiny/Parser.pm lib/TOML/Tiny/Tokenizer.pm lib/TOML/Tiny/Util.pm lib/TOML/Tiny/Writer.pm perlimports.toml t/00-report-prereqs.dd t/00-report-prereqs.t t/author-pod-syntax.t t/faithful.t t/numbers.t t/parity.t t/parser.t t/strict_arrays.t t/toml-test/invalid/array/missing-separator.t t/toml-test/invalid/array/missing-separator.toml t/toml-test/invalid/array/no-close-2.t t/toml-test/invalid/array/no-close-2.toml t/toml-test/invalid/array/no-close-table-2.t t/toml-test/invalid/array/no-close-table-2.toml t/toml-test/invalid/array/no-close-table.t t/toml-test/invalid/array/no-close-table.toml t/toml-test/invalid/array/no-close.t t/toml-test/invalid/array/no-close.toml t/toml-test/invalid/array/tables-1.t t/toml-test/invalid/array/tables-1.toml t/toml-test/invalid/array/tables-2.t t/toml-test/invalid/array/tables-2.toml t/toml-test/invalid/array/text-after-array-entries.t t/toml-test/invalid/array/text-after-array-entries.toml t/toml-test/invalid/array/text-before-array-separator.t t/toml-test/invalid/array/text-before-array-separator.toml t/toml-test/invalid/array/text-in-array.t t/toml-test/invalid/array/text-in-array.toml t/toml-test/invalid/bool/mixed-case.t t/toml-test/invalid/bool/mixed-case.toml t/toml-test/invalid/bool/wrong-case-false.t t/toml-test/invalid/bool/wrong-case-false.toml t/toml-test/invalid/bool/wrong-case-true.t t/toml-test/invalid/bool/wrong-case-true.toml t/toml-test/invalid/control/comment-del.t t/toml-test/invalid/control/comment-del.toml t/toml-test/invalid/control/comment-lf.t t/toml-test/invalid/control/comment-lf.toml t/toml-test/invalid/control/comment-null.t t/toml-test/invalid/control/comment-null.toml t/toml-test/invalid/control/comment-us.t t/toml-test/invalid/control/comment-us.toml t/toml-test/invalid/control/multi-del.t t/toml-test/invalid/control/multi-del.toml t/toml-test/invalid/control/multi-lf.t t/toml-test/invalid/control/multi-lf.toml t/toml-test/invalid/control/multi-null.t t/toml-test/invalid/control/multi-null.toml t/toml-test/invalid/control/multi-us.t t/toml-test/invalid/control/multi-us.toml t/toml-test/invalid/control/rawmulti-del.t t/toml-test/invalid/control/rawmulti-del.toml t/toml-test/invalid/control/rawmulti-lf.t t/toml-test/invalid/control/rawmulti-lf.toml t/toml-test/invalid/control/rawmulti-null.t t/toml-test/invalid/control/rawmulti-null.toml t/toml-test/invalid/control/rawmulti-us.t t/toml-test/invalid/control/rawmulti-us.toml t/toml-test/invalid/control/rawstring-del.t t/toml-test/invalid/control/rawstring-del.toml t/toml-test/invalid/control/rawstring-lf.t t/toml-test/invalid/control/rawstring-lf.toml t/toml-test/invalid/control/rawstring-null.t t/toml-test/invalid/control/rawstring-null.toml t/toml-test/invalid/control/rawstring-us.t t/toml-test/invalid/control/rawstring-us.toml t/toml-test/invalid/control/string-bs.t t/toml-test/invalid/control/string-bs.toml t/toml-test/invalid/control/string-del.t t/toml-test/invalid/control/string-del.toml t/toml-test/invalid/control/string-lf.t t/toml-test/invalid/control/string-lf.toml t/toml-test/invalid/control/string-null.t t/toml-test/invalid/control/string-null.toml t/toml-test/invalid/control/string-us.t t/toml-test/invalid/control/string-us.toml t/toml-test/invalid/datetime/impossible-date.t t/toml-test/invalid/datetime/impossible-date.toml t/toml-test/invalid/datetime/no-leads-with-milli.t t/toml-test/invalid/datetime/no-leads-with-milli.toml t/toml-test/invalid/datetime/no-leads.t t/toml-test/invalid/datetime/no-leads.toml t/toml-test/invalid/datetime/no-secs.t t/toml-test/invalid/datetime/no-secs.toml t/toml-test/invalid/datetime/no-t.t t/toml-test/invalid/datetime/no-t.toml t/toml-test/invalid/datetime/trailing-t.t t/toml-test/invalid/datetime/trailing-t.toml t/toml-test/invalid/encoding/bad-utf8-at-end.t t/toml-test/invalid/encoding/bad-utf8-at-end.toml t/toml-test/invalid/encoding/bad-utf8-in-comment.t t/toml-test/invalid/encoding/bad-utf8-in-comment.toml t/toml-test/invalid/encoding/bad-utf8-in-string.t t/toml-test/invalid/encoding/bad-utf8-in-string.toml t/toml-test/invalid/encoding/bom-not-at-start-1.t t/toml-test/invalid/encoding/bom-not-at-start-1.toml t/toml-test/invalid/encoding/bom-not-at-start-2.t t/toml-test/invalid/encoding/bom-not-at-start-2.toml t/toml-test/invalid/encoding/utf16-bom.t t/toml-test/invalid/encoding/utf16-bom.toml t/toml-test/invalid/encoding/utf16.t t/toml-test/invalid/encoding/utf16.toml t/toml-test/invalid/float/double-point-1.t t/toml-test/invalid/float/double-point-1.toml t/toml-test/invalid/float/double-point-2.t t/toml-test/invalid/float/double-point-2.toml t/toml-test/invalid/float/exp-double-e-1.t t/toml-test/invalid/float/exp-double-e-1.toml t/toml-test/invalid/float/exp-double-e-2.t t/toml-test/invalid/float/exp-double-e-2.toml t/toml-test/invalid/float/exp-double-us.t t/toml-test/invalid/float/exp-double-us.toml t/toml-test/invalid/float/exp-leading-us.t t/toml-test/invalid/float/exp-leading-us.toml t/toml-test/invalid/float/exp-point-1.t t/toml-test/invalid/float/exp-point-1.toml t/toml-test/invalid/float/exp-point-2.t t/toml-test/invalid/float/exp-point-2.toml t/toml-test/invalid/float/exp-trailing-us.t t/toml-test/invalid/float/exp-trailing-us.toml t/toml-test/invalid/float/inf-incomplete-1.t t/toml-test/invalid/float/inf-incomplete-1.toml t/toml-test/invalid/float/inf-incomplete-2.t t/toml-test/invalid/float/inf-incomplete-2.toml t/toml-test/invalid/float/inf-incomplete-3.t t/toml-test/invalid/float/inf-incomplete-3.toml t/toml-test/invalid/float/inf_underscore.t t/toml-test/invalid/float/inf_underscore.toml t/toml-test/invalid/float/leading-point-neg.t t/toml-test/invalid/float/leading-point-neg.toml t/toml-test/invalid/float/leading-point-plus.t t/toml-test/invalid/float/leading-point-plus.toml t/toml-test/invalid/float/leading-point.t t/toml-test/invalid/float/leading-point.toml t/toml-test/invalid/float/leading-us.t t/toml-test/invalid/float/leading-us.toml t/toml-test/invalid/float/leading-zero-neg.t t/toml-test/invalid/float/leading-zero-neg.toml t/toml-test/invalid/float/leading-zero-plus.t t/toml-test/invalid/float/leading-zero-plus.toml t/toml-test/invalid/float/leading-zero.t t/toml-test/invalid/float/leading-zero.toml t/toml-test/invalid/float/nan-incomplete-1.t t/toml-test/invalid/float/nan-incomplete-1.toml t/toml-test/invalid/float/nan-incomplete-2.t t/toml-test/invalid/float/nan-incomplete-2.toml t/toml-test/invalid/float/nan-incomplete-3.t t/toml-test/invalid/float/nan-incomplete-3.toml t/toml-test/invalid/float/nan_underscore.t t/toml-test/invalid/float/nan_underscore.toml t/toml-test/invalid/float/trailing-point-min.t t/toml-test/invalid/float/trailing-point-min.toml t/toml-test/invalid/float/trailing-point-plus.t t/toml-test/invalid/float/trailing-point-plus.toml t/toml-test/invalid/float/trailing-point.t t/toml-test/invalid/float/trailing-point.toml t/toml-test/invalid/float/trailing-us.t t/toml-test/invalid/float/trailing-us.toml t/toml-test/invalid/float/us-after-point.t t/toml-test/invalid/float/us-after-point.toml t/toml-test/invalid/float/us-before-point.t t/toml-test/invalid/float/us-before-point.toml t/toml-test/invalid/inline-table/double-comma.t t/toml-test/invalid/inline-table/double-comma.toml t/toml-test/invalid/inline-table/empty.t t/toml-test/invalid/inline-table/empty.toml t/toml-test/invalid/inline-table/linebreak-1.t t/toml-test/invalid/inline-table/linebreak-1.toml t/toml-test/invalid/inline-table/linebreak-2.t t/toml-test/invalid/inline-table/linebreak-2.toml t/toml-test/invalid/inline-table/linebreak-3.t t/toml-test/invalid/inline-table/linebreak-3.toml t/toml-test/invalid/inline-table/linebreak-4.t t/toml-test/invalid/inline-table/linebreak-4.toml t/toml-test/invalid/inline-table/no-comma.t t/toml-test/invalid/inline-table/no-comma.toml t/toml-test/invalid/inline-table/trailing-comma.t t/toml-test/invalid/inline-table/trailing-comma.toml t/toml-test/invalid/integer/capital-bin.t t/toml-test/invalid/integer/capital-bin.toml t/toml-test/invalid/integer/capital-hex.t t/toml-test/invalid/integer/capital-hex.toml t/toml-test/invalid/integer/capital-oct.t t/toml-test/invalid/integer/capital-oct.toml t/toml-test/invalid/integer/double-sign-nex.t t/toml-test/invalid/integer/double-sign-nex.toml t/toml-test/invalid/integer/double-sign-plus.t t/toml-test/invalid/integer/double-sign-plus.toml t/toml-test/invalid/integer/double-us.t t/toml-test/invalid/integer/double-us.toml t/toml-test/invalid/integer/invalid-bin.t t/toml-test/invalid/integer/invalid-bin.toml t/toml-test/invalid/integer/invalid-hex.t t/toml-test/invalid/integer/invalid-hex.toml t/toml-test/invalid/integer/invalid-oct.t t/toml-test/invalid/integer/invalid-oct.toml t/toml-test/invalid/integer/leading-us-bin.t t/toml-test/invalid/integer/leading-us-bin.toml t/toml-test/invalid/integer/leading-us-hex.t t/toml-test/invalid/integer/leading-us-hex.toml t/toml-test/invalid/integer/leading-us-oct.t t/toml-test/invalid/integer/leading-us-oct.toml t/toml-test/invalid/integer/leading-us.t t/toml-test/invalid/integer/leading-us.toml t/toml-test/invalid/integer/leading-zero-1.t t/toml-test/invalid/integer/leading-zero-1.toml t/toml-test/invalid/integer/leading-zero-2.t t/toml-test/invalid/integer/leading-zero-2.toml t/toml-test/invalid/integer/leading-zero-sign-1.t t/toml-test/invalid/integer/leading-zero-sign-1.toml t/toml-test/invalid/integer/leading-zero-sign-2.t t/toml-test/invalid/integer/leading-zero-sign-2.toml t/toml-test/invalid/integer/negative-bin.t t/toml-test/invalid/integer/negative-bin.toml t/toml-test/invalid/integer/negative-hex.t t/toml-test/invalid/integer/negative-hex.toml t/toml-test/invalid/integer/negative-oct.t t/toml-test/invalid/integer/negative-oct.toml t/toml-test/invalid/integer/positive-bin.t t/toml-test/invalid/integer/positive-bin.toml t/toml-test/invalid/integer/positive-hex.t t/toml-test/invalid/integer/positive-hex.toml t/toml-test/invalid/integer/positive-oct.t t/toml-test/invalid/integer/positive-oct.toml t/toml-test/invalid/integer/text-after-integer.t t/toml-test/invalid/integer/text-after-integer.toml t/toml-test/invalid/integer/trailing-us-bin.t t/toml-test/invalid/integer/trailing-us-bin.toml t/toml-test/invalid/integer/trailing-us-hex.t t/toml-test/invalid/integer/trailing-us-hex.toml t/toml-test/invalid/integer/trailing-us-oct.t t/toml-test/invalid/integer/trailing-us-oct.toml t/toml-test/invalid/integer/trailing-us.t t/toml-test/invalid/integer/trailing-us.toml t/toml-test/invalid/integer/us-after-bin.t t/toml-test/invalid/integer/us-after-bin.toml t/toml-test/invalid/integer/us-after-hex.t t/toml-test/invalid/integer/us-after-hex.toml t/toml-test/invalid/integer/us-after-oct.t t/toml-test/invalid/integer/us-after-oct.toml t/toml-test/invalid/key/after-array.t t/toml-test/invalid/key/after-array.toml t/toml-test/invalid/key/after-table.t t/toml-test/invalid/key/after-table.toml t/toml-test/invalid/key/after-value.t t/toml-test/invalid/key/after-value.toml t/toml-test/invalid/key/bare-invalid-character.t t/toml-test/invalid/key/bare-invalid-character.toml t/toml-test/invalid/key/dotted-redefine-table.t t/toml-test/invalid/key/dotted-redefine-table.toml t/toml-test/invalid/key/duplicate-keys.t t/toml-test/invalid/key/duplicate-keys.toml t/toml-test/invalid/key/duplicate.t t/toml-test/invalid/key/duplicate.toml t/toml-test/invalid/key/empty.t t/toml-test/invalid/key/empty.toml t/toml-test/invalid/key/escape.t t/toml-test/invalid/key/escape.toml t/toml-test/invalid/key/hash.t t/toml-test/invalid/key/hash.toml t/toml-test/invalid/key/multiline.t t/toml-test/invalid/key/multiline.toml t/toml-test/invalid/key/newline.t t/toml-test/invalid/key/newline.toml t/toml-test/invalid/key/no-eol.t t/toml-test/invalid/key/no-eol.toml t/toml-test/invalid/key/open-bracket.t t/toml-test/invalid/key/open-bracket.toml t/toml-test/invalid/key/partial-quoted.t t/toml-test/invalid/key/partial-quoted.toml t/toml-test/invalid/key/single-open-bracket.t t/toml-test/invalid/key/single-open-bracket.toml t/toml-test/invalid/key/space.t t/toml-test/invalid/key/space.toml t/toml-test/invalid/key/special-character.t t/toml-test/invalid/key/special-character.toml t/toml-test/invalid/key/start-bracket.t t/toml-test/invalid/key/start-bracket.toml t/toml-test/invalid/key/two-equals.t t/toml-test/invalid/key/two-equals.toml t/toml-test/invalid/key/two-equals2.t t/toml-test/invalid/key/two-equals2.toml t/toml-test/invalid/key/two-equals3.t t/toml-test/invalid/key/two-equals3.toml t/toml-test/invalid/key/without-value-1.t t/toml-test/invalid/key/without-value-1.toml t/toml-test/invalid/key/without-value-2.t t/toml-test/invalid/key/without-value-2.toml t/toml-test/invalid/string/bad-byte-escape.t t/toml-test/invalid/string/bad-byte-escape.toml t/toml-test/invalid/string/bad-codepoint.t t/toml-test/invalid/string/bad-codepoint.toml t/toml-test/invalid/string/bad-concat.t t/toml-test/invalid/string/bad-concat.toml t/toml-test/invalid/string/bad-escape.t t/toml-test/invalid/string/bad-escape.toml t/toml-test/invalid/string/bad-multiline.t t/toml-test/invalid/string/bad-multiline.toml t/toml-test/invalid/string/bad-slash-escape.t t/toml-test/invalid/string/bad-slash-escape.toml t/toml-test/invalid/string/bad-uni-esc.t t/toml-test/invalid/string/bad-uni-esc.toml t/toml-test/invalid/string/basic-byte-escapes.t t/toml-test/invalid/string/basic-byte-escapes.toml t/toml-test/invalid/string/basic-multiline-out-of-range-unicode-escape-1.t t/toml-test/invalid/string/basic-multiline-out-of-range-unicode-escape-1.toml t/toml-test/invalid/string/basic-multiline-out-of-range-unicode-escape-2.t t/toml-test/invalid/string/basic-multiline-out-of-range-unicode-escape-2.toml t/toml-test/invalid/string/basic-multiline-quotes.t t/toml-test/invalid/string/basic-multiline-quotes.toml t/toml-test/invalid/string/basic-multiline-unknown-escape.t t/toml-test/invalid/string/basic-multiline-unknown-escape.toml t/toml-test/invalid/string/basic-out-of-range-unicode-escape-1.t t/toml-test/invalid/string/basic-out-of-range-unicode-escape-1.toml t/toml-test/invalid/string/basic-out-of-range-unicode-escape-2.t t/toml-test/invalid/string/basic-out-of-range-unicode-escape-2.toml t/toml-test/invalid/string/basic-unknown-escape.t t/toml-test/invalid/string/basic-unknown-escape.toml t/toml-test/invalid/string/literal-multiline-quotes-1.t t/toml-test/invalid/string/literal-multiline-quotes-1.toml t/toml-test/invalid/string/literal-multiline-quotes-2.t t/toml-test/invalid/string/literal-multiline-quotes-2.toml t/toml-test/invalid/string/missing-quotes.t t/toml-test/invalid/string/missing-quotes.toml t/toml-test/invalid/string/multiline-escape-space.t t/toml-test/invalid/string/multiline-escape-space.toml t/toml-test/invalid/string/multiline-no-close-2.t t/toml-test/invalid/string/multiline-no-close-2.toml t/toml-test/invalid/string/multiline-no-close.t t/toml-test/invalid/string/multiline-no-close.toml t/toml-test/invalid/string/multiline-quotes-1.t t/toml-test/invalid/string/multiline-quotes-1.toml t/toml-test/invalid/string/multiline-quotes-2.t t/toml-test/invalid/string/multiline-quotes-2.toml t/toml-test/invalid/string/no-close.t t/toml-test/invalid/string/no-close.toml t/toml-test/invalid/string/text-after-string.t t/toml-test/invalid/string/text-after-string.toml t/toml-test/invalid/string/wrong-close.t t/toml-test/invalid/string/wrong-close.toml t/toml-test/invalid/table/array-empty.t t/toml-test/invalid/table/array-empty.toml t/toml-test/invalid/table/array-implicit.t t/toml-test/invalid/table/array-implicit.toml t/toml-test/invalid/table/array-missing-bracket.t t/toml-test/invalid/table/array-missing-bracket.toml t/toml-test/invalid/table/duplicate-key-table.t t/toml-test/invalid/table/duplicate-key-table.toml t/toml-test/invalid/table/duplicate-table-array.t t/toml-test/invalid/table/duplicate-table-array.toml t/toml-test/invalid/table/duplicate-table-array2.t t/toml-test/invalid/table/duplicate-table-array2.toml t/toml-test/invalid/table/duplicate.t t/toml-test/invalid/table/duplicate.toml t/toml-test/invalid/table/empty-implicit-table.t t/toml-test/invalid/table/empty-implicit-table.toml t/toml-test/invalid/table/empty.t t/toml-test/invalid/table/empty.toml t/toml-test/invalid/table/equals-sign.t t/toml-test/invalid/table/equals-sign.toml t/toml-test/invalid/table/llbrace.t t/toml-test/invalid/table/llbrace.toml t/toml-test/invalid/table/nested-brackets-close.t t/toml-test/invalid/table/nested-brackets-close.toml t/toml-test/invalid/table/nested-brackets-open.t t/toml-test/invalid/table/nested-brackets-open.toml t/toml-test/invalid/table/quoted-no-close.t t/toml-test/invalid/table/quoted-no-close.toml t/toml-test/invalid/table/redefine.t t/toml-test/invalid/table/redefine.toml t/toml-test/invalid/table/rrbrace.t t/toml-test/invalid/table/rrbrace.toml t/toml-test/invalid/table/text-after-table.t t/toml-test/invalid/table/text-after-table.toml t/toml-test/invalid/table/whitespace.t t/toml-test/invalid/table/whitespace.toml t/toml-test/invalid/table/with-pound.t t/toml-test/invalid/table/with-pound.toml t/toml-test/valid/array/array.t t/toml-test/valid/array/array.toml t/toml-test/valid/array/bool.t t/toml-test/valid/array/bool.toml t/toml-test/valid/array/empty.t t/toml-test/valid/array/empty.toml t/toml-test/valid/array/hetergeneous.t t/toml-test/valid/array/hetergeneous.toml t/toml-test/valid/array/mixed-int-array.t t/toml-test/valid/array/mixed-int-array.toml t/toml-test/valid/array/mixed-int-float.t t/toml-test/valid/array/mixed-int-float.toml t/toml-test/valid/array/mixed-int-string.t t/toml-test/valid/array/mixed-int-string.toml t/toml-test/valid/array/mixed-string-table.t t/toml-test/valid/array/mixed-string-table.toml t/toml-test/valid/array/nested-double.t t/toml-test/valid/array/nested-double.toml t/toml-test/valid/array/nested-inline-table.t t/toml-test/valid/array/nested-inline-table.toml t/toml-test/valid/array/nested.t t/toml-test/valid/array/nested.toml t/toml-test/valid/array/nospaces.t t/toml-test/valid/array/nospaces.toml t/toml-test/valid/array/string-quote-comma-2.t t/toml-test/valid/array/string-quote-comma-2.toml t/toml-test/valid/array/string-quote-comma.t t/toml-test/valid/array/string-quote-comma.toml t/toml-test/valid/array/string-with-comma.t t/toml-test/valid/array/string-with-comma.toml t/toml-test/valid/array/strings.t t/toml-test/valid/array/strings.toml t/toml-test/valid/array/table-array-string-backslash.t t/toml-test/valid/array/table-array-string-backslash.toml t/toml-test/valid/bool/bool.t t/toml-test/valid/bool/bool.toml t/toml-test/valid/comment/at-eof.t t/toml-test/valid/comment/at-eof.toml t/toml-test/valid/comment/at-eof2.t t/toml-test/valid/comment/at-eof2.toml t/toml-test/valid/comment/everywhere.t t/toml-test/valid/comment/everywhere.toml t/toml-test/valid/comment/tricky.t t/toml-test/valid/comment/tricky.toml t/toml-test/valid/datetime/datetime.t t/toml-test/valid/datetime/datetime.toml t/toml-test/valid/datetime/local-date.t t/toml-test/valid/datetime/local-date.toml t/toml-test/valid/datetime/local-time.t t/toml-test/valid/datetime/local-time.toml t/toml-test/valid/datetime/local.t t/toml-test/valid/datetime/local.toml t/toml-test/valid/datetime/milliseconds.t t/toml-test/valid/datetime/milliseconds.toml t/toml-test/valid/datetime/timezone.t t/toml-test/valid/datetime/timezone.toml t/toml-test/valid/empty-file.t t/toml-test/valid/empty-file.toml t/toml-test/valid/example.t t/toml-test/valid/example.toml t/toml-test/valid/float/exponent.t t/toml-test/valid/float/exponent.toml t/toml-test/valid/float/float.t t/toml-test/valid/float/float.toml t/toml-test/valid/float/inf-and-nan.t t/toml-test/valid/float/inf-and-nan.toml t/toml-test/valid/float/long.t t/toml-test/valid/float/long.toml t/toml-test/valid/float/underscore.t t/toml-test/valid/float/underscore.toml t/toml-test/valid/float/zero.t t/toml-test/valid/float/zero.toml t/toml-test/valid/implicit-and-explicit-after.t t/toml-test/valid/implicit-and-explicit-after.toml t/toml-test/valid/implicit-and-explicit-before.t t/toml-test/valid/implicit-and-explicit-before.toml t/toml-test/valid/implicit-groups.t t/toml-test/valid/implicit-groups.toml t/toml-test/valid/inline-table/array.t t/toml-test/valid/inline-table/array.toml t/toml-test/valid/inline-table/bool.t t/toml-test/valid/inline-table/bool.toml t/toml-test/valid/inline-table/empty.t t/toml-test/valid/inline-table/empty.toml t/toml-test/valid/inline-table/end-in-bool.t t/toml-test/valid/inline-table/end-in-bool.toml t/toml-test/valid/inline-table/inline-table.t t/toml-test/valid/inline-table/inline-table.toml t/toml-test/valid/inline-table/key-dotted.t t/toml-test/valid/inline-table/key-dotted.toml t/toml-test/valid/inline-table/multiline.t t/toml-test/valid/inline-table/multiline.toml t/toml-test/valid/inline-table/nest.t t/toml-test/valid/inline-table/nest.toml t/toml-test/valid/integer/integer.t t/toml-test/valid/integer/integer.toml t/toml-test/valid/integer/literals.t t/toml-test/valid/integer/literals.toml t/toml-test/valid/integer/long.t t/toml-test/valid/integer/long.toml t/toml-test/valid/integer/underscore.t t/toml-test/valid/integer/underscore.toml t/toml-test/valid/integer/zero.t t/toml-test/valid/integer/zero.toml t/toml-test/valid/key/alphanum.t t/toml-test/valid/key/alphanum.toml t/toml-test/valid/key/case-sensitive.t t/toml-test/valid/key/case-sensitive.toml t/toml-test/valid/key/dotted.t t/toml-test/valid/key/dotted.toml t/toml-test/valid/key/empty.t t/toml-test/valid/key/empty.toml t/toml-test/valid/key/equals-nospace.t t/toml-test/valid/key/equals-nospace.toml t/toml-test/valid/key/escapes.t t/toml-test/valid/key/escapes.toml t/toml-test/valid/key/numeric-dotted.t t/toml-test/valid/key/numeric-dotted.toml t/toml-test/valid/key/numeric.t t/toml-test/valid/key/numeric.toml t/toml-test/valid/key/quoted-dots.t t/toml-test/valid/key/quoted-dots.toml t/toml-test/valid/key/space.t t/toml-test/valid/key/space.toml t/toml-test/valid/key/special-chars.t t/toml-test/valid/key/special-chars.toml t/toml-test/valid/key/special-word.t t/toml-test/valid/key/special-word.toml t/toml-test/valid/newline-crlf.t t/toml-test/valid/newline-crlf.toml t/toml-test/valid/newline-lf.t t/toml-test/valid/newline-lf.toml t/toml-test/valid/spec-example-1-compact.t t/toml-test/valid/spec-example-1-compact.toml t/toml-test/valid/spec-example-1.t t/toml-test/valid/spec-example-1.toml t/toml-test/valid/string/double-quote-escape.t t/toml-test/valid/string/double-quote-escape.toml t/toml-test/valid/string/empty.t t/toml-test/valid/string/empty.toml t/toml-test/valid/string/escape-tricky.t t/toml-test/valid/string/escape-tricky.toml t/toml-test/valid/string/escaped-escape.t t/toml-test/valid/string/escaped-escape.toml t/toml-test/valid/string/escapes.t t/toml-test/valid/string/escapes.toml t/toml-test/valid/string/multiline-quotes.t t/toml-test/valid/string/multiline-quotes.toml t/toml-test/valid/string/nl.t t/toml-test/valid/string/nl.toml t/toml-test/valid/string/raw-multiline.t t/toml-test/valid/string/raw-multiline.toml t/toml-test/valid/string/raw.t t/toml-test/valid/string/raw.toml t/toml-test/valid/string/simple.t t/toml-test/valid/string/simple.toml t/toml-test/valid/string/unicode-escape.t t/toml-test/valid/string/unicode-escape.toml t/toml-test/valid/string/unicode-literal.t t/toml-test/valid/string/unicode-literal.toml t/toml-test/valid/string/with-pound.t t/toml-test/valid/string/with-pound.toml t/toml-test/valid/table/array-implicit.t t/toml-test/valid/table/array-implicit.toml t/toml-test/valid/table/array-many.t t/toml-test/valid/table/array-many.toml t/toml-test/valid/table/array-nest.t t/toml-test/valid/table/array-nest.toml t/toml-test/valid/table/array-one.t t/toml-test/valid/table/array-one.toml t/toml-test/valid/table/array-table-array.t t/toml-test/valid/table/array-table-array.toml t/toml-test/valid/table/empty.t t/toml-test/valid/table/empty.toml t/toml-test/valid/table/keyword.t t/toml-test/valid/table/keyword.toml t/toml-test/valid/table/names.t t/toml-test/valid/table/names.toml t/toml-test/valid/table/no-eol.t t/toml-test/valid/table/no-eol.toml t/toml-test/valid/table/sub-empty.t t/toml-test/valid/table/sub-empty.toml t/toml-test/valid/table/whitespace.t t/toml-test/valid/table/whitespace.toml t/toml-test/valid/table/with-literal-string.t t/toml-test/valid/table/with-literal-string.toml t/toml-test/valid/table/with-pound.t t/toml-test/valid/table/with-pound.toml t/toml-test/valid/table/with-single-quotes.t t/toml-test/valid/table/with-single-quotes.toml t/toml-test/valid/table/without-super.t t/toml-test/valid/table/without-super.toml t/writer.t TOML-Tiny-0.20/Dockerfile0000644000175000017500000000030414770631453013554 0ustar olafolafFROM perl:latest RUN mkdir /toml-tiny WORKDIR /toml-tiny COPY ./ ./ RUN cpanm -nq Dist::Zilla RUN dzil authordeps --missing | cpanm -nq RUN dzil listdeps --missing | cpanm -nq RUN dzil test -j8 TOML-Tiny-0.20/MANIFEST.SKIP0000644000175000017500000000003214770631453013456 0ustar olafolafscratch.pl build-tests.pl TOML-Tiny-0.20/Makefile.PL0000644000175000017500000000436114770631453013543 0ustar olafolaf# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.032. use strict; use warnings; use 5.018; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "a minimal, pure perl TOML parser and serializer", "AUTHOR" => "Jeff Ober ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "TOML-Tiny", "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.018", "NAME" => "TOML::Tiny", "PREREQ_PM" => { "Carp" => 0, "Data::Dumper" => 0, "Encode" => 0, "Exporter" => 0, "Math::BigInt" => "1.999718" }, "TEST_REQUIRES" => { "Data::Dumper" => 0, "DateTime::Format::ISO8601" => 0, "DateTime::Format::RFC3339" => 0, "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "TOML::Parser" => 0, "Test2::V0" => 0, "Test::More" => 0, "Test::Pod" => 0 }, "VERSION" => "0.20", "test" => { "TESTS" => "t/*.t t/toml-test/invalid/array/*.t t/toml-test/invalid/bool/*.t t/toml-test/invalid/control/*.t t/toml-test/invalid/datetime/*.t t/toml-test/invalid/encoding/*.t t/toml-test/invalid/float/*.t t/toml-test/invalid/inline-table/*.t t/toml-test/invalid/integer/*.t t/toml-test/invalid/key/*.t t/toml-test/invalid/string/*.t t/toml-test/invalid/table/*.t t/toml-test/valid/*.t t/toml-test/valid/array/*.t t/toml-test/valid/bool/*.t t/toml-test/valid/comment/*.t t/toml-test/valid/datetime/*.t t/toml-test/valid/float/*.t t/toml-test/valid/inline-table/*.t t/toml-test/valid/integer/*.t t/toml-test/valid/key/*.t t/toml-test/valid/string/*.t t/toml-test/valid/table/*.t" } ); my %FallbackPrereqs = ( "Carp" => 0, "Data::Dumper" => 0, "DateTime::Format::ISO8601" => 0, "DateTime::Format::RFC3339" => 0, "Encode" => 0, "Exporter" => 0, "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "Math::BigInt" => "1.999718", "TOML::Parser" => 0, "Test2::V0" => 0, "Test::More" => 0, "Test::Pod" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); TOML-Tiny-0.20/dist.ini0000644000175000017500000000065114770631453013233 0ustar olafolafname = TOML-Tiny author = Jeff Ober license = Perl_5 copyright_holder = Jeff Ober [@Basic] [Git::Check] [Git::NextVersion] first_version = 0.01 [NextRelease] format = %v %{yyyy-MM-dd}d [ReadmeAnyFromPod / ReadmePodInRoot] type = pod [GithubMeta] issues = 1 [PkgVersion] [PodSyntaxTests] [Test::ReportPrereqs] [Prereqs::FromCPANfile] [MetaJSON] [Git::Commit] [Git::Tag] [Git::Push] [PodWeaver] TOML-Tiny-0.20/README0000644000175000017500000000056614770631453012454 0ustar olafolafThis archive contains the distribution TOML-Tiny, version 0.20: a minimal, pure perl TOML parser and serializer This software is copyright (c) 2025 by Jeff Ober. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. This README file was generated by Dist::Zilla::Plugin::Readme v6.032. TOML-Tiny-0.20/perlimports.toml0000644000175000017500000000211214770631453015036 0ustar olafolaf# Valid log levels are: # debug, info, notice, warning, error, critical, alert, emergency # critical, alert and emergency are not currently used. # # Please use boolean values in this config file. Negated options (--no-*) are # not permitted here. Explicitly set options to true or false. # # Some of these values deviate from the regular perlimports defaults. In # particular, you're encouraged to leave preserve_duplicates and # preserve_unused disabled. cache = false # setting this to true is currently discouraged ignore_modules = ["Test2::V0"] ignore_modules_filename = "" ignore_modules_pattern = "" # regex like "^(Foo|Foo::Bar)" ignore_modules_pattern_filename = "" libs = ["lib", "t/lib"] log_filename = "" log_level = "warn" never_export_modules = [] never_export_modules_filename = "" padding = false preserve_duplicates = false preserve_unused = false tidy_whitespace = true TOML-Tiny-0.20/cpanfile0000644000175000017500000000112514770631453013270 0ustar olafolafrequires 'perl' => '>= 5.018'; requires 'Carp' => '0'; requires 'Data::Dumper' => '0'; requires 'Exporter' => '0'; requires 'Encode' => '0'; requires 'Math::BigInt' => '>= 1.999718'; recommends 'Types::Serialiser' => 0; on test => sub{ requires 'Data::Dumper' => '0'; requires 'DateTime::Format::ISO8601' => '0'; requires 'TOML::Parser' => '0'; requires 'Test2::V0' => '0'; requires 'Test::Pod' => '0'; requires 'DateTime::Format::RFC3339' => '0'; recommends 'Unicode::GCString' => '0'; }; TOML-Tiny-0.20/META.json0000644000175000017500000000400414770631453013204 0ustar olafolaf{ "abstract" : "a minimal, pure perl TOML parser and serializer", "author" : [ "Jeff Ober " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.032, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "TOML-Tiny", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "develop" : { "requires" : { "Test::Pod" : "1.41" } }, "runtime" : { "recommends" : { "Types::Serialiser" : "0" }, "requires" : { "Carp" : "0", "Data::Dumper" : "0", "Encode" : "0", "Exporter" : "0", "Math::BigInt" : "1.999718", "perl" : "5.018" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900", "Unicode::GCString" : "0" }, "requires" : { "Data::Dumper" : "0", "DateTime::Format::ISO8601" : "0", "DateTime::Format::RFC3339" : "0", "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "TOML::Parser" : "0", "Test2::V0" : "0", "Test::More" : "0", "Test::Pod" : "0" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/sysread/TOML-Tiny/issues" }, "homepage" : "https://github.com/sysread/TOML-Tiny", "repository" : { "type" : "git", "url" : "https://github.com/sysread/TOML-Tiny.git", "web" : "https://github.com/sysread/TOML-Tiny" } }, "version" : "0.20", "x_generated_by_perl" : "v5.40.0", "x_serialization_backend" : "Cpanel::JSON::XS version 4.39", "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later" } TOML-Tiny-0.20/META.yml0000644000175000017500000000206514770631453013041 0ustar olafolaf--- abstract: 'a minimal, pure perl TOML parser and serializer' author: - 'Jeff Ober ' build_requires: Data::Dumper: '0' DateTime::Format::ISO8601: '0' DateTime::Format::RFC3339: '0' ExtUtils::MakeMaker: '0' File::Spec: '0' TOML::Parser: '0' Test2::V0: '0' Test::More: '0' Test::Pod: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.032, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: TOML-Tiny recommends: Types::Serialiser: '0' requires: Carp: '0' Data::Dumper: '0' Encode: '0' Exporter: '0' Math::BigInt: '1.999718' perl: '5.018' resources: bugtracker: https://github.com/sysread/TOML-Tiny/issues homepage: https://github.com/sysread/TOML-Tiny repository: https://github.com/sysread/TOML-Tiny.git version: '0.20' x_generated_by_perl: v5.40.0 x_serialization_backend: 'YAML::Tiny version 1.76' x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' TOML-Tiny-0.20/lib/0000775000175000017500000000000014770631453012335 5ustar olafolafTOML-Tiny-0.20/lib/TOML/0000775000175000017500000000000014770631453013110 5ustar olafolafTOML-Tiny-0.20/lib/TOML/Tiny.pm0000644000175000017500000002515214770631453014374 0ustar olafolafpackage TOML::Tiny; # ABSTRACT: a minimal, pure perl TOML parser and serializer $TOML::Tiny::VERSION = '0.20'; use strict; use warnings; no warnings qw(experimental); use v5.18; use TOML::Tiny::Parser (); use TOML::Tiny::Writer (); use parent 'Exporter'; our @EXPORT = qw( from_toml to_toml ); #------------------------------------------------------------------------------- # TOML module compatibility #------------------------------------------------------------------------------- sub from_toml { my ($source, %param) = @_; # strict was previously strict_arrays; accept both for backward # compatibility. if (exists $param{strict_arrays}) { $param{strict} = $param{strict_arrays}; delete $param{strict_arrays}; } my $parser = TOML::Tiny::Parser->new(%param); my $toml = eval{ $parser->parse($source) }; if (wantarray) { return ($toml, $@); } else { die $@ if $@; return $toml; } } sub to_toml { my ($data, %param) = @_; # strict was previously strict_arrays; accept both for backward # compatibility. if (exists $param{strict_arrays}) { $param{strict} = $param{strict_arrays}; delete $param{strict_arrays}; } TOML::Tiny::Writer::to_toml($data, %param); } #------------------------------------------------------------------------------- # Object API #------------------------------------------------------------------------------- sub new { my ($class, %param) = @_; bless{ %param, parser => TOML::Tiny::Parser->new(%param) }, $class; } sub decode { my ($self, $source) = @_; $self->{parser}->parse($source); } sub encode { my ($self, $data) = @_; TOML::Tiny::Writer::to_toml( $data, strict => $self->{strict}, no_string_guessing => $self->{no_string_guessing}, ); } #------------------------------------------------------------------------------- # For compatibility with TOML::from_toml's use of $TOML::Parser #------------------------------------------------------------------------------- sub parse { goto \&decode; } 1; __END__ =pod =encoding UTF-8 =head1 NAME TOML::Tiny - a minimal, pure perl TOML parser and serializer =head1 VERSION version 0.20 =head1 SYNOPSIS use TOML::Tiny qw(from_toml to_toml); binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; # Decoding TOML my $toml = do{ local $/; }; my ($parsed, $error) = from_toml $toml; # Encoding TOML say to_toml({ stuff => { about => ['other', 'stuff'], }, }); # Object API my $parser = TOML::Tiny->new; my $data = $parser->decode($toml); say $parser->encode($data); =head1 DESCRIPTION =for html

Build status

C implements a pure-perl parser and generator for the L data format. It conforms to TOML v1.0 (with a few caveats; see L). C strives to maintain an interface compatible to the L and L modules, and could even be used to override C<$TOML::Parser>: use TOML; use TOML::Tiny; local $TOML::Parser = TOML::Tiny->new(...); say to_toml(...); =head1 EXPORTS C exports the following to functions for compatibility with the L module. See L. =head2 from_toml Parses a string of C-formatted source and returns the resulting data structure. Any arguments after the first are passed to L's constructor. If there is a syntax error in the C source, C will die with an explanation which includes the line number of the error. my $result = eval{ from_toml($toml_string) }; Alternately, this routine may be called in list context, in which case syntax errors will result in returning two values, C and an error message. my ($result, $error) = from_toml($toml_string); Additional arguments may be passed after the toml source string; see L. =head3 GOTCHAS =over =item Big integers and floats C supports integers and floats larger than what many perls support. When C encounters a value it may not be able to represent as a number, it will instead return a L or L. This behavior can be overridden by providing inflation routines: my $toml = TOML::Tiny->new( inflate_float => sub{ return do_something_else_with_floats( $_[0] ); }; ); =back =head2 to_toml Encodes a hash ref as a C-formatted string. my $toml = to_toml({foo => {'bar' => 'bat'}}); # [foo] # bar="bat" =head3 mapping perl to TOML types =head4 table =over =item C ref =back =head4 array =over =item C ref =back =head4 boolean =over =item C<\0> or C<\1> =item L =item L =back =head4 numeric types These are tricky in perl. When encountering a C, that representation is used. If the value is a defined (non-ref) scalar with the C or C flags set, the value will be emitted unchanged. This is in line with most other packages, so the normal hinting hacks for typed output apply: number => 0 + $number, string => "" . $string, =over =item L =item L =item numerical scalars =back =head4 datetime =over =item RFC3339-formatted string e.g., C<"1985-04-12T23:20:50.52Z"> =item L Ls are formatted as C, as expected by C. However, C supports the concept of a "local" time zone, which strays from C by allowing a datetime without a time zone offset. This is represented in perl by a C with a B. =back =head4 string All other non-ref scalars are treated as strings. =head1 OBJECT API =head2 new =over =item inflate_datetime By default, C treats TOML datetimes as strings in the generated data structure. The C parameter allows the caller to provide a routine to intercept those as they are generated: use DateTime::Format::RFC3339; my $parser = TOML::Tiny->new( inflate_datetime => sub{ my ($dt_string) = @_; # DateTime::Format::RFC3339 will set the resulting DateTime's formatter # to itself. Fallback is the DateTime default, ISO8601, with a possibly # floating time zone. return eval{ DateTime::Format::RFC3339->parse_datetime($dt_string) } || DateTime::Format::ISO8601->parse_datetime($dt_string); }, ); =item inflate_boolean By default, boolean values in a C document result in a C<1> or C<0>. If L is installed, they will instead be C or C. If you wish to override this, you can provide your own routine to generate values: my $parser = TOML::Tiny->new( inflate_boolean => sub{ my $bool = shift; if ($bool eq 'true') { return 'The Truth'; } else { return 'A Lie'; } }, ); =item inflate_integer TOML integers are 64 bit and may not match the size of the compiled perl's internal integer type. By default, C coerces numbers that fit within a perl number by adding C<0>. For bignums, a L is returned. This may be overridden by providing an inflation routine: my $parser = TOML::Tiny->new( inflate_integer => sub{ my $parsed = shift; return sprintf 'the number "%d"', $parsed; }; ); =item inflate_float TOML floats are 64 bit and may not match the size of the compiled perl's internal float type. As with integers, floats are coerced to numbers and large floats are upgraded to Ls. The special strings C and C may also be returned. You can override this by specifying an inflation routine. my $parser = TOML::Tiny->new( inflate_float => sub{ my $parsed = shift; return sprintf '"%0.8f" is a float', $parsed; }; ); =item strict C imposes some miscellaneous strictures on C input, such as disallowing trailing commas in inline tables and failing on invalid UTF8 input. B C was previously called C. Both are accepted for backward compatibility, although enforcement of homogenous arrays is no longer supported as it has been dropped from the spec. =back =head2 decode Decodes C and returns a hash ref. Dies on parse error. =head2 encode Encodes a perl hash ref as a C-formatted string. =head2 parse Alias for C to provide compatibility with C when overriding the parser by setting C<$TOML::Parser>. =head1 DIFFERENCES FROM L AND L C differs in a few significant ways from the L module, particularly in adding support for newer C features and strictness. L defaults to lax parsing and provides C to (slightly) tighten things up. C defaults to (somewhat) stricter parsing, enabling some extra strictures with L. C supports a number of options which do not exist in L: L, L, and L. C ignores invalid surrogate pairs within basic and multiline strings (L may attempt to decode an invalid pair). Additionally, only those character escapes officially supported by TOML are interpreted as such by C. C supports stripping initial whitespace and handles lines terminating with a backslash correctly in multilne strings: # TOML input x=""" foo""" y="""\ how now \ brown \ bureaucrat.\ """ # Perl output {x => 'foo', y => 'how now brown bureaucrat.'} C includes support for integers specified in binary, octal or hex as well as the special float values C and C. =head1 SEE ALSO =over =item L Regexp scraps used by C to parse TOML source. =back =head1 ACKNOWLEDGEMENTS Thanks to L for encouraging their employees to contribute back to the open source ecosystem. Without their dedication to quality software development this distribution would not exist. A big thank you to those who have contributed code or bug reports: =over =item L =item L =item L =item L =back =head1 AUTHOR Jeff Ober =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2025 by Jeff Ober. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut TOML-Tiny-0.20/lib/TOML/Tiny/0000775000175000017500000000000014770631453014033 5ustar olafolafTOML-Tiny-0.20/lib/TOML/Tiny/Writer.pm0000644000175000017500000001634514770631453015654 0ustar olafolafpackage TOML::Tiny::Writer; $TOML::Tiny::Writer::VERSION = '0.20'; use strict; use warnings; no warnings qw(experimental); use v5.18; use B qw(SVf_IOK SVf_NOK svref_2object); use Data::Dumper qw(Dumper); use TOML::Tiny::Grammar qw($BareKey $DateTime $SpecialFloat); use TOML::Tiny::Util qw(is_strict_array); use constant CORE_BOOL => defined &builtin::is_bool; my @KEYS; sub to_toml { my $data = shift; die 'toml: data to encode must be a hashref' if ref $data ne 'HASH'; return _to_toml( $data, { @_ } ); } sub _to_toml ($$); sub _to_toml ($$) { my $data = shift; my $param = shift; die 'toml: found undefined value, which is unsupported by TOML' if ! defined $data; my $ref = ref $data; if ($ref eq 'HASH') { return to_toml_table($data, $param); } if ($ref eq 'ARRAY') { return to_toml_array($data, $param); } if ($ref eq 'SCALAR') { if ($$data eq '1') { return 'true'; } elsif ($$data eq '0') { return 'false'; } else { return _to_toml($$_, $param); } } if ($ref eq 'JSON::PP::Boolean') { return $$data ? 'true' : 'false'; } if ($ref eq 'Types::Serializer::Boolean') { return $data ? 'true' : 'false'; } if ($ref eq 'DateTime') { return strftime_rfc3339($data); } if ($ref eq 'Math::BigInt') { return $data->bstr; } if ($ref eq 'Math::BigFloat') { if ($data->is_inf || $data->is_nan) { return lc $data->bstr; } else { return $data->bstr; } } if ($ref eq '') { if (CORE_BOOL && builtin::is_bool($data)) { return $data ? 'true' : 'false'; } # Thanks to ikegami on Stack Overflow for the trick! # https://stackoverflow.com/questions/12686335/how-to-tell-apart-numeric-scalars-and-string-scalars-in-perl/12693984#12693984 # note: this must come before any regex can flip this flag off if (svref_2object(\$data)->FLAGS & (SVf_IOK | SVf_NOK)) { return 'inf' if Math::BigFloat->new($data)->is_inf; return '-inf' if Math::BigFloat->new($data)->is_inf('-'); return 'nan' if Math::BigFloat->new($data)->is_nan; return $data; } return to_toml_string($data) if $param->{no_string_guessing}; #return $data if svref_2object(\$data)->FLAGS & (SVf_IOK | SVf_NOK); return $data if $data =~ /^$DateTime$/; return lc($data) if $data =~ /^$SpecialFloat$/; return to_toml_string($data); } die 'unhandled: '.Dumper($ref); } sub to_toml_inline_table { my ($data, $param) = @_; my @buff; for my $k (keys %$data) { my $key = to_toml_key($k); my $val = $data->{$k}; if (ref $val eq 'HASH') { push @buff, $key . '=' . to_toml_inline_table($val); } else { push @buff, $key . '=' . _to_toml($val, $param); } } return '{' . join(', ', @buff) . '}'; } sub to_toml_table { my ($data, $param) = @_; my @buff_assign; my @buff_tables; # Generate simple key/value pairs for scalar data 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_assign, "$key=$val"; } # For arrays, generate an array of tables if all elements of the array are # hashes. For mixed arrays, generate an inline array. ARRAY: for my $k (grep{ ref $data->{$_} eq 'ARRAY' } sort keys %$data) { # Empty table if (!@{$data->{$k}}) { my $key = to_toml_key($k); push @buff_assign, "$key=[]"; next ARRAY; } # Mixed array if (grep{ ref $_ ne 'HASH' } @{$data->{$k}}) { my $key = to_toml_key($k); my $val = _to_toml($data->{$k}, $param); push @buff_assign, "$key=$val"; } # Array of tables else { push @KEYS, $k; for (@{ $data->{$k} }) { push @buff_tables, '', '[[' . join('.', map{ to_toml_key($_) } @KEYS) . ']]'; push @buff_tables, _to_toml($_, $param); } pop @KEYS; } } # Sub-tables for my $k (grep{ ref $data->{$_} eq 'HASH' } sort keys %$data) { if (!keys(%{$data->{$k}})) { # Empty table my $key = to_toml_key($k); push @buff_assign, "$key={}"; } else { # Generate [table] push @KEYS, $k; push @buff_tables, '', '[' . join('.', map{ to_toml_key($_) } @KEYS) . ']'; push @buff_tables, _to_toml($data->{$k}, $param); pop @KEYS; } } join "\n", @buff_assign, @buff_tables; } sub to_toml_array { my ($data, $param) = @_; if (@$data && $param->{strict}) { my ($ok, $err) = is_strict_array($data); die "toml: found heterogenous array, but strict is set ($err)\n" unless $ok; } my @items; for my $item (@$data) { if (ref $item eq 'HASH') { push @items, to_toml_inline_table($item, $param); } else { push @items, _to_toml($item, $param); } } return "[\n" . join("\n", map{ " $_," } @items) . "\n]"; } sub to_toml_key { my $str = shift; if ($str =~ /^$BareKey$/) { return $str; } else { # Not valid as a "bare key". Encode it as a "quoted key" # (in TOML terminology), using the "literal string" format. return to_toml_string($str); } } sub to_toml_string { state $escape = { "\n" => '\n', "\r" => '\r', "\t" => '\t', "\f" => '\f', "\b" => '\b', "\"" => '\"', "\\" => '\\\\', "\'" => '\\\'', }; my ($arg) = @_; $arg =~ s/(["\\\b\f\n\r\t])/$escape->{$1}/g; $arg =~ s/([\p{General_Category=Control}])/'\\u00' . unpack('H2', $1)/eg; return '"' . $arg . '"'; } #------------------------------------------------------------------------------- # Adapted from DateTime::Format::RFC3339. #------------------------------------------------------------------------------- sub strftime_rfc3339 { my ($dt) = @_; my $tz; #----------------------------------------------------------------------------- # Calculate the time zone offset for non-UTC time zones. # # TOML uses RFC3339 for datetimes, but supports a "local datetime" which # excludes the timezone offset. A DateTime with a floating time zone # indicates a TOML local datetime. # # DateTime::Format::RFC3339 requires a time zone, however, and defaults to # +00:00 for floating time zones. To support local datetimes in output, # format the datetime as RFC3339 and strip the timezone when encountering a # floating time zone. #----------------------------------------------------------------------------- if ($dt->time_zone_short_name eq 'floating') { $tz = ''; } elsif ($dt->time_zone->is_utc) { $tz = 'Z'; } else { my $sign = $dt->offset < 0 ? '-' : '+'; my $secs = abs $dt->offset; my $mins = int($secs / 60); $secs %= 60; my $hours = int($mins / 60); $mins %= 60; if ($secs) { $dt = $dt->clone; $dt->set_time_zone('UTC'); $tz = 'Z'; } else { $tz = sprintf '%s%02d:%02d', $sign, $hours, $mins; } } my $format = $dt->nanosecond ? '%Y-%m-%dT%H:%M:%S.%9N' : '%Y-%m-%dT%H:%M:%S'; return $dt->strftime($format) . $tz; } 1; __END__ =pod =encoding UTF-8 =head1 NAME TOML::Tiny::Writer =head1 VERSION version 0.20 =head1 AUTHOR Jeff Ober =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2025 by Jeff Ober. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut TOML-Tiny-0.20/lib/TOML/Tiny/Util.pm0000644000175000017500000000302314770631453015302 0ustar olafolafpackage TOML::Tiny::Util; # ABSTRACT: utility functions used by TOML::Tiny $TOML::Tiny::Util::VERSION = '0.20'; use strict; use warnings; no warnings 'experimental'; use v5.18; use TOML::Tiny::Grammar; use parent 'Exporter'; our @EXPORT_OK = qw( is_strict_array ); my @_type_map = ( [ qr{Float}, 'float' ], [ qr{Int}, 'integer' ], [ qr{Boolean}, 'bool' ], [ qr{^$Boolean}, 'bool' ], [ qr{^$Float}, 'float' ], [ qr{^$Integer}, 'integer' ], [ qr{^$DateTime}, 'float' ], ); sub is_strict_array { my $arr = shift; my @types = map{ my $value = $_; my $type; my $ref = ref($value); if ($ref eq 'ARRAY') { $type = 'array'; } elsif ($ref eq 'HASH') { $type = 'table'; } # Do a little heuristic guess-work else { for my $pair (@_type_map) { if ( $ref =~ m{$pair->[0]} ) { $type = $pair->[1]; } last; } } $type //= 'string'; return $type; } @$arr; my $t = shift @types; for (@types) { return (undef, "expected value of type $t, but found $_") if $_ ne $t; } return (1, undef); } 1; __END__ =pod =encoding UTF-8 =head1 NAME TOML::Tiny::Util - utility functions used by TOML::Tiny =head1 VERSION version 0.20 =head1 AUTHOR Jeff Ober =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2025 by Jeff Ober. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut TOML-Tiny-0.20/lib/TOML/Tiny/Tokenizer.pm0000644000175000017500000001407714770631453016352 0ustar olafolafpackage TOML::Tiny::Tokenizer; # ABSTRACT: tokenizer used by TOML::Tiny $TOML::Tiny::Tokenizer::VERSION = '0.20'; use strict; use warnings; no warnings qw(experimental); use charnames qw(:full); use v5.18; use TOML::Tiny::Grammar qw( $Comment $CRLF $DateTime $EOL $Escape $Float $Integer $Key $SimpleKey $String $WS ); sub new { my ($class, %param) = @_; my $self = bless{ source => $param{source}, last_position => length $param{source}, position => 0, line => 1, last_token => undef, }, $class; return $self; } sub last_token { my $self = shift; return $self->{last_token}; } sub next_token { my $self = shift; return unless defined $self->{source} && $self->{position} < $self->{last_position}; if (!$self->{last_token}) { return $self->{last_token} = {type => 'table', pos => 0, line => 1, value => []}; } # Update the regex engine's position marker in case some other regex # attempted to match against the source string and reset it. pos($self->{source}) = $self->{position}; my $token; my $type; my $value; state $key_set = qr/\G ($Key) $WS* (?= =)/x; state $table = qr/\G \[ $WS* ($Key) $WS* \] $WS* (?:$EOL | $)/x; state $array_table = qr/\G \[\[ $WS* ($Key) $WS* \]\] $WS* (?:$EOL | $)/x; state $simple = { '[' => 'inline_array', ']' => 'inline_array_close', '{' => 'inline_table', '}' => 'inline_table_close', ',' => 'comma', '=' => 'assign', 'true' => 'bool', 'false' => 'bool', }; # More complex matches with regexps while ($self->{position} < $self->{last_position} && !defined($type)) { my $prev = $self->{last_token} ? $self->{last_token}{type} : 'EOL'; my $newline = !!($prev eq 'EOL' || $prev eq 'table' || $prev eq 'array_table'); for ($self->{source}) { /\G$WS+/gc; # ignore whitespace /\G$Comment$/mgc && next; # ignore comments last if /\G$/gc; if (/\G$EOL/gc) { ++$self->{line}; $type = 'EOL'; last; } if ($newline) { if (/$table/gc) { $type = 'table'; $value = $self->tokenize_key($1); last; } if (/$array_table/gc) { $type = 'array_table'; $value = $self->tokenize_key($1); last; } } if (/$key_set/gc) { $type = 'key'; $value = $1; last; } if (/\G ( [\[\]{}=,] | true | false )/xgc) { $value = $1; $type = $simple->{$value}; last; } if (/\G($String)/gc) { $type = 'string'; $value = $1; last; } if (/\G($DateTime)/gc) { $type = 'datetime'; $value = $1; last; } if (/\G($Float)/gc) { $type = 'float'; $value = $1; last; } if (/\G($Integer)/gc) { $type = 'integer'; $value = $1; last; } my $substr = substr($self->{source}, $self->{position}, 30) // 'undef'; die "toml syntax error on line $self->{line}\n\t-->|$substr|\n"; } if ($type) { state $tokenizers = {}; my $tokenize = $tokenizers->{$type} //= $self->can("tokenize_$type") || 0; $token = { line => $self->{line}, pos => $self->{pos}, type => $type, value => $tokenize ? $tokenize->($self, $value) : $value, prev => $self->{last_token}, }; # Unset the previous token's 'prev' key to prevent keeping the entire # chain of previously parsed tokens alive for the whole process. undef $self->{last_token}{prev}; $self->{last_token} = $token; } $self->update_position; } return $token; } sub current_line { my $self = shift; my $rest = substr $self->{source}, $self->{position}; my $stop = index $rest, "\n"; substr $rest, 0, $stop; } sub update_position { my $self = shift; $self->{position} = pos($self->{source}) // 0; } sub error { my $self = shift; my $token = shift; my $msg = shift // 'unknown'; my $line = $token ? $token->{line} : $self->{line}; die "toml: parse error at line $line: $msg\n"; } sub tokenize_key { my $self = shift; my $toml = shift; my @segs = $toml =~ /($SimpleKey)\.?/g; my @keys; for my $seg (@segs) { $seg = $self->tokenize_string($seg) if $seg =~ m/^['"]/; push @keys, $seg; } return \@keys; } sub tokenize_float { $_[1] =~ tr/_//d; $_[1]; } sub tokenize_integer { $_[1] =~ tr/_+//d; $_[1]; } sub tokenize_string { my $self = shift; my $toml = shift; my $ml = index($toml, q{'''}) == 0 || index($toml, q{"""}) == 0; my $lit = index($toml, q{'}) == 0; my $str = ''; if ($ml) { $str = substr $toml, 3, length($toml) - 6; my @newlines = $str =~ /($CRLF)/g; $self->{line} += scalar @newlines; $str =~ s/^$WS* $CRLF//x; # trim leading whitespace $str =~ s/\\$EOL\s*//xgs; # trim newlines from lines ending in backslash } else { $str = substr($toml, 1, length($toml) - 2); } if (!$lit) { $str = $self->unescape_str($str); } return $str; } sub unescape_chars { state $esc = { '\b' => "\x08", '\t' => "\x09", '\n' => "\x0A", '\f' => "\x0C", '\r' => "\x0D", '\"' => "\x22", '\/' => "\x2F", '\\\\' => "\x5C", }; if (exists $esc->{$_[0]}) { return $esc->{$_[0]}; } my $hex = hex substr($_[0], 2); if ($hex < 0x10FFFF && charnames::viacode($hex)) { return chr $hex; } return; } sub unescape_str { state $re = qr/($Escape)/; $_[1] =~ s|$re|unescape_chars($1) // $_[0]->error(undef, "invalid unicode escape: $1")|xge; $_[1]; } 1; __END__ =pod =encoding UTF-8 =head1 NAME TOML::Tiny::Tokenizer - tokenizer used by TOML::Tiny =head1 VERSION version 0.20 =head1 AUTHOR Jeff Ober =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2025 by Jeff Ober. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut TOML-Tiny-0.20/lib/TOML/Tiny/Parser.pm0000644000175000017500000003116214770631453015626 0ustar olafolafpackage TOML::Tiny::Parser; # ABSTRACT: parser used by TOML::Tiny $TOML::Tiny::Parser::VERSION = '0.20'; use utf8; use strict; use warnings; no warnings qw(experimental); use v5.18; use Carp qw(confess); use Data::Dumper qw(Dumper); use Encode qw(decode FB_CROAK); use Math::BigFloat (); use Math::BigInt (); use TOML::Tiny::Grammar qw($TimeOffset); use TOML::Tiny::Tokenizer (); our $TRUE = 1; our $FALSE = 0; eval{ require Types::Serialiser; $TRUE = Types::Serialiser::true(); $FALSE = Types::Serialiser::false(); }; sub new { my ($class, %param) = @_; bless{ inflate_integer => $param{inflate_integer}, inflate_float => $param{inflate_float}, inflate_datetime => $param{inflate_datetime} || sub{ shift }, inflate_boolean => $param{inflate_boolean} || sub{ shift eq 'true' ? $TRUE : $FALSE }, strict => $param{strict}, }, $class; } sub next_token { my $self = shift; my $token = $self->{tokenizer} && $self->{tokenizer}->next_token; return $token; } sub parse { my ($self, $toml) = @_; if ($self->{strict}) { $toml = decode('UTF-8', "$toml", FB_CROAK); } $self->{tokenizer} = TOML::Tiny::Tokenizer->new(source => $toml); $self->{keys} = []; $self->{root} = {}; $self->{tables} = {}; # "seen" hash of explicitly defined table names (e.g. [foo]) $self->{arrays} = {}; # "seen" hash of explicitly defined static arrays (e.g. foo=[]) $self->{array_tables} = {}; # "seen" hash of explicitly defined arrays of tables (e.g. [[foo]]) $self->parse_table; my $result = $self->{root}; delete $self->{tokenizer}; delete $self->{keys}; delete $self->{root}; delete $self->{tables}; delete $self->{arrays}; delete $self->{array_tables}; return $result; } sub parse_error { my ($self, $token, $msg) = @_; my $line = $token ? $token->{line} : 'EOF'; if ($ENV{TOML_TINY_DEBUG}) { my $root = Dumper($self->{root}); my $tok = Dumper($token); my $src = substr $self->{tokenizer}{source}, $self->{tokenizer}{position}, 30; confess qq{ toml parse error at line $line: $msg Current token: $tok Parse state: $root Source near location of error: ... $src ... }; } else { die "toml parse error at line $line: $msg\n"; } } sub expect_type { my ($self, $token, $expected) = @_; my $actual = $token ? $token->{type} : 'EOF'; $self->parse_error($token, "expected $expected, but found $actual") unless $actual =~ /$expected/; } sub current_key { my $self = shift; my @keys = $self->get_keys; my $key = join '.', map{ qq{"$_"} } @keys; return $key; } sub push_keys { my ($self, $token) = @_; push @{ $self->{keys} }, $token->{value}; } sub pop_keys { my $self = shift; pop @{ $self->{keys} }; } sub get_keys { my $self = shift; return map{ @$_ } @{ $self->{keys} }; } sub set_key { my ($self, $token) = @_; my @keys = $self->get_keys; my $key = pop @keys; my $node = $self->scan_to_key(\@keys); if ($key && exists $node->{$key}) { $self->parse_error($token, 'duplicate key: ' . $self->current_key); } $node->{$key} = $self->parse_value($token); } sub declare_key { my ($self, $token) = @_; my $key = $self->current_key || return; if ($token->{type} eq 'inline_array') { $self->parse_error($token, "duplicate key: $key") if exists $self->{array_tables}{$key}; $self->{arrays}{$key} = 1; return; } if ($token->{type} eq 'array_table') { if (exists $self->{arrays}{$key}) { $self->parse_error($token, "duplicate key: $key"); } $self->{array_tables}{$key} = 1; return; } if ($token->{type} eq 'table') { $self->parse_error($token, "duplicate key: $key") if exists $self->{arrays}{$key} || exists $self->{array_tables}{$key}; if (exists $self->{tables}{$key}) { # Tables cannot be redefined, *except* when doing so within a goddamn # table array. Gawd I hate TOML. my $in_a_stupid_table_array = 0; my $node = $self->{root}; for my $key ($self->get_keys) { if (exists $node->{$key} && ref($node->{$key}) eq 'ARRAY') { $in_a_stupid_table_array = 1; last; } else { $node = $node->{$key}; } } unless ($in_a_stupid_table_array) { $self->parse_error($token, "duplicate key: $key"); } return; } $self->{tables}{$key} = 1; } } sub scan_to_key { my $self = shift; my $keys = shift // [ $self->get_keys ]; my $node = $self->{root}; KEY: for my $key (@$keys) { if (exists $node->{$key}) { my $ref = ref $node->{$key}; if ( $ref eq 'HASH' ) { $node = $node->{$key}; next KEY; } if ( $ref eq 'ARRAY' ) { $node = $node->{$key}[-1]; next KEY; } my $full_key = join '.', @$keys; die "$full_key is already defined\n"; } else { $node = $node->{$key} = {}; } } return $node; } sub parse_table { my $self = shift; my $token = shift // $self->next_token // return; # may be undef on first token in empty document $self->expect_type($token, 'table'); $self->push_keys($token); $self->scan_to_key; $self->declare_key($token); TOKEN: while (my $token = $self->next_token) { my $type = $token->{type}; next TOKEN if $type eq 'EOL'; if ( $type eq 'key') { $self->expect_type($self->next_token, 'assign'); $self->push_keys($token); $self->set_key($self->next_token); $self->pop_keys; if (my $eol = $self->next_token) { $self->expect_type($eol, 'EOL'); } else { return; } next TOKEN; } if ($type eq 'array_table') { $self->pop_keys; @_ = ($self, $token); goto \&parse_array_table; } if ( $type eq 'table') { $self->pop_keys; @_ = ($self, $token); goto \&parse_table; } $self->parse_error($token, "expected key-value pair, table, or array of tables but got $type"); } } sub parse_array_table { my $self = shift; my $token = shift // $self->next_token; $self->expect_type($token, 'array_table'); $self->push_keys($token); $self->declare_key($token); my @keys = $self->get_keys; my $key = pop @keys; my $node = $self->scan_to_key(\@keys); $node->{$key} //= []; push @{ $node->{$key} }, {}; TOKEN: while (my $token = $self->next_token) { my $type = $token->{type}; next TOKEN if $type eq 'EOL'; if ($type eq 'key') { $self->expect_type($self->next_token, 'assign'); $self->push_keys($token); $self->set_key($self->next_token); $self->pop_keys; next TOKEN; } if ($type eq 'array_table') { $self->pop_keys; @_ = ($self, $token); goto \&parse_array_table; } if ($type eq 'table') { $self->pop_keys; @_ = ($self, $token); goto \&parse_table; } $self->parse_error($token, "expected key-value pair, table, or array of tables but got $type"); } } sub parse_key { my $self = shift; my $token = shift // $self->next_token; $self->expect_type($token, 'key'); return $token->{value}; } sub parse_value { my $self = shift; my $token = shift; my $type = $token->{type}; return $token->{value} if $type eq 'string'; return $self->inflate_float($token) if $type eq'float'; return $self->inflate_integer($token) if $type eq 'integer'; return $self->{inflate_boolean}->($token->{value}) if $type eq 'bool'; return $self->parse_datetime($token) if $type eq 'datetime'; return $self->parse_inline_table($token) if $type eq 'inline_table'; return $self->parse_array($token) if $type eq 'inline_array'; $self->parse_error($token, "value expected (bool, number, string, datetime, inline array, inline table), but found $type"); } #------------------------------------------------------------------------------- # TOML permits a space instead of a T, which RFC3339 does not allow. TOML (at # least, according to BurntSushi/toml-tests) allows z instead of Z, which # RFC3339 also does not permit. We will be flexible and allow them both, but # fix them up. TOML also specifies millisecond precision. If fractional seconds # are specified. Whatever. #------------------------------------------------------------------------------- sub parse_datetime { my $self = shift; my $token = shift; my $value = $token->{value}; # Normalize $value =~ tr/z/Z/; $value =~ tr/ /T/; $value =~ s/t/T/; $value =~ s/(\.\d+)($TimeOffset)$/sprintf(".%09d%s", $1 * 1000000000, $2)/e; return $self->{inflate_datetime}->($value); } sub parse_array { my $self = shift; my $token = shift; $self->declare_key($token); my @array; my $expect = 'EOL|inline_array_close|string|float|integer|bool|datetime|inline_table|inline_array'; TOKEN: while (1) { my $token = $self->next_token; $self->expect_type($token, $expect); if ( $token->{type} eq 'comma') { $expect = 'EOL|inline_array_close|string|float|integer|bool|datetime|inline_table|inline_array'; next TOKEN; } next TOKEN if $token->{type} eq 'EOL'; last TOKEN if $token->{type} eq 'inline_array_close'; push @array, $self->parse_value($token); $expect = 'comma|EOL|inline_array_close'; } return \@array; } sub parse_inline_table { my $self = shift; my $token = shift; my $table = {}; my $expect = 'EOL|inline_table_close|key'; TOKEN: while (1) { my $token = $self->next_token; $self->expect_type($token, $expect); my $type = $token->{type}; if ($type eq 'comma') { $expect = $self->{strict} ? 'EOL|key' : 'EOL|key|inline_table_close'; next TOKEN; } if ($type eq 'key') { $self->expect_type($self->next_token, 'assign'); my $node = $table; my @keys = @{ $token->{value} }; my $key = pop @keys; for (@keys) { $node->{$_} ||= {}; $node = $node->{$_}; } if (exists $node->{$key}) { $self->parse_error($token, 'duplicate key: ' . join('.', map{ qq{"$_"} } @{ $token->{value} })); } else { $node->{ $key } = $self->parse_value($self->next_token); } $expect = 'comma|inline_table_close'; next TOKEN; } last TOKEN if $type eq 'inline_table_close'; $self->parse_error($token, "inline table expected key-value pair, but found $type"); } return $table; } sub inflate_float { my $self = shift; my $token = shift; my $value = $token->{value}; # Caller-defined inflation routine if ($self->{inflate_float}) { return $self->{inflate_float}->($value); } return 'NaN' if $value =~ /^[-+]?nan$/i; return 'inf' if $value =~ /^\+?inf$/i; return '-inf' if $value =~ /^-inf$/i; # Not a bignum if (0 + $value eq $value) { return 0 + $value; } #----------------------------------------------------------------------------- # Scientific notation is a hairier situation. In order to determine whether a # value will fit inside a perl svnv, we can't just coerce the value to a # number and then test it against the string, because, for example, this will # always be false: # # 9 eq "3e2" # # Instead, we are forced to test the coerced value against a BigFloat, which # is capable of holding the number. #----------------------------------------------------------------------------- if ($value =~ /[eE]/) { if (Math::BigFloat->new($value)->beq(0 + $value)) { return 0 + $value; } } return Math::BigFloat->new($value); } sub inflate_integer { my $self = shift; my $token = shift; my $value = $token->{value}; # Caller-defined inflation routine if ($self->{inflate_integer}) { return $self->{inflate_integer}->($value); } # Hex if ($value =~ /^0x/) { no warnings 'portable'; my $hex = hex $value; my $big = Math::BigInt->new($value); return $big->beq($hex) ? $hex : $big; } # Octal if ($value =~ /^0o/) { no warnings 'portable'; $value =~ s/^0o/0/; my $oct = oct $value; my $big = Math::BigInt->from_oct($value); return $big->beq($oct) ? $oct : $big; } # Binary if ($value =~ /^0b/) { no warnings 'portable'; my $bin = oct $value; # oct handles 0b as binary my $big = Math::BigInt->new($value); return $big->beq($bin) ? $bin : $big; } # Not a bignum if (0 + $value eq $value) { return 0 + $value; } return Math::BigInt->new($value); } 1; __END__ =pod =encoding UTF-8 =head1 NAME TOML::Tiny::Parser - parser used by TOML::Tiny =head1 VERSION version 0.20 =head1 AUTHOR Jeff Ober =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2025 by Jeff Ober. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut TOML-Tiny-0.20/lib/TOML/Tiny/Grammar.pm0000644000175000017500000001675314770631453015771 0ustar olafolafpackage TOML::Tiny::Grammar; # ABSTRACT: exports regex definitions used to parse TOML source $TOML::Tiny::Grammar::VERSION = '0.20'; use strict; use warnings; use v5.18; use parent 'Exporter'; our @EXPORT = qw( $WS $CRLF $EOL $Comment $NonASCII $BareKey $QuotedKey $SimpleKey $DottedKey $Key $Boolean $Escape $StringLiteral $MultiLineStringLiteral $BasicString $MultiLineString $String $Date $Time $DateTime $TimeOffset $Hex $Oct $Bin $Dec $Integer $Float $SpecialFloat ); #------------------------------------------------------------------------------- # Primitives #------------------------------------------------------------------------------- our $WS = qr/[\x20\x09]/; # space, tab our $CRLF = qr/\x0D?\x0A/; # cr? lf our $CommentChar = qr/(?>[^[:cntrl:]]|\t)/; # non-control chars other than tab our $Comment = qr/\x23$CommentChar*/; # #comment our $EOL = qr/$Comment?$CRLF/; # crlf or comment + crlf our $Boolean = qr/\b(?:true)|(?:false)\b/; our $NonASCII = qr/[\x80-\x{D7FF}\x{E000}-\x{10FFFF}]/; #------------------------------------------------------------------------------- # Strings #------------------------------------------------------------------------------- our $Escape = qr{ \x5C # leading \ (?> [\x5C"btfnr] # escapes: \\ \" \b \t \n \f \r | (?> u [_0-9a-fA-F]{4}) # unicode (4 bytes) | (?> U [_0-9a-fA-F]{8}) # unicode (8 bytes) ) }x; our $LiteralChar = qr{ [\x09\x20-\x26\x28-\x7E] | $NonASCII }x; our $StringLiteral = qr{ ' (?: $LiteralChar )* ' }x; our $MLLChar = qr{ [\x09\x20-\x26\x28-\x7E] | $NonASCII }x; our $MLLContent = qr{ $MLLChar | $CRLF }x; our $MLLQuotes = qr{ '{1,2} }x; our $MLLBody = qr{ $MLLContent* (?: $MLLQuotes | $MLLContent{0,1} )*? $MLLQuotes? }x; our $MultiLineStringLiteral = qr{ ''' (?: $CRLF? $MLLBody ) ''' }x; our $BasicChar = qr{ $WS | [\x21\x23-\x5B\x5D-\x7E] | $NonASCII | $Escape }x; our $BasicString = qr{ " (?: $BasicChar )* " }x; our $MLBEscapedNL = qr{ \x5c $WS* $CRLF (?: $WS | $CRLF)* }x; our $MLBUnescaped = qr{ $WS | [\x21\x23-\x5B\x5D-\x7E] | $NonASCII }x; our $MLBQuotes = qr{ "{1,2} }x; our $MLBChar = qr{ $MLBUnescaped | $Escape }x; our $MLBContent = qr{ $MLBChar | $CRLF | $MLBEscapedNL }x; our $MLBasicBody = qr{ $MLBContent* (?: $MLBQuotes | $MLBContent{0,1} )*? $MLBQuotes? }x; our $MultiLineString = qr{ """ $CRLF? $MLBasicBody """ }x; our $String = qr/$MultiLineString | $BasicString | $MultiLineStringLiteral | $StringLiteral/x; #------------------------------------------------------------------------------- # Keys #------------------------------------------------------------------------------- our $BareKey = qr/[-_\p{PosixAlnum}]+/; our $QuotedKey = qr/$BasicString|$StringLiteral/; our $SimpleKey = qr/$QuotedKey|$BareKey/; our $DottedKey = qr/$SimpleKey (?: $WS* \. $WS* $SimpleKey)+/x; our $Key = qr{ (?: $DottedKey | $SimpleKey ) }x; #----------------------------------------------------------------------------- # Dates (RFC 3339) # 1985-04-12T23:20:50.52Z #----------------------------------------------------------------------------- our $DateFullYear = qr{ \d{4} }x; our $DateMonth = qr{ (?: 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 ) }x; our $DateDay = qr{ (?: 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 ) }x; our $TimeDelim = qr{ (?: [tT] | \x20 ) }x; our $TimeHour = qr{ (?: 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 ) }x; our $TimeMinute = qr{ (?: 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 ) }x; our $TimeSecond = qr{ (?: 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 ) }x; # may be 60 during leap second our $TimeSecFrac = qr{ \. \d+ }x; our $TimeNumOffset = qr{ (?: [-+] $TimeHour : $TimeMinute ) }x; our $TimeOffset = qr{ (?: [zZ] | $TimeNumOffset ) }x; our $PartialTime = qr{ (?: $TimeHour : $TimeMinute : $TimeSecond $TimeSecFrac? ) }x; our $FullTime = qr{ (?: $PartialTime $TimeOffset ) }x; our $FullDate = qr{ (?: $DateFullYear - $DateMonth - $DateDay ) }x; our $OffsetDateTime = qr{ (?: $FullDate $TimeDelim $FullTime ) }x; our $LocalDateTime = qr{ (?: $FullDate $TimeDelim $PartialTime ) }x; our $LocalDate = qr{ (?: $FullDate ) }x; our $LocalTime = qr{ (?: $PartialTime ) }x; our $DateTime = qr{ (?: $OffsetDateTime | $LocalDateTime | $LocalDate | $LocalTime ) }x; #----------------------------------------------------------------------------- # Integer #----------------------------------------------------------------------------- our $DecFirstChar = qr/[1-9]/; our $DecChar = qr/[0-9]/; our $HexChar = qr/[0-9a-fA-F]/; our $OctChar = qr/[0-7]/; our $BinChar = qr/[01]/; our $Zero = qr/[-+]? 0/x; our $Hex = qr/0x $HexChar (?> _? $HexChar )*/x; our $Oct = qr/0o $OctChar (?> _? $OctChar )*/x; our $Bin = qr/0b $BinChar (?> _? $BinChar )*/x; our $Dec = qr/$Zero | (?> [-+]? $DecFirstChar (?> _? $DecChar )* )/x; our $Integer = qr/$Hex | $Oct | $Bin | $Dec/x; #----------------------------------------------------------------------------- # Float #----------------------------------------------------------------------------- our $SpecialFloat = qr/[-+]? (?: (?:inf) | (?:nan) | (?:NaN) )/x; our $Fraction = qr/\. $DecChar (?> _? $DecChar)*/x; our $Exponent = qr{ [eE] (?> $Zero+ # dec matches only one zero, but toml exponents apparently accept e00 | $Dec ) }x; our $Float = qr{ (?> $Dec (?> (?> $Fraction $Exponent?) | $Exponent ) ) | $SpecialFloat }x; 1; __END__ =pod =encoding UTF-8 =head1 NAME TOML::Tiny::Grammar - exports regex definitions used to parse TOML source =head1 VERSION version 0.20 =head1 SYNOPSIS use TOML::Tiny::Grammar; if ($src =~ /$MultiLineString/) { ... } =head1 DESCRIPTION Exports various regexex for parsing TOML source. =head1 PATTERNS =head2 White space and ignorables =head3 $WS =head3 $CRLF =head3 $EOL =head3 $Comment =head2 Keys =head3 $BareKey =head3 $QuotedKey =head3 $SimpleKey =head3 $DottedKey =head3 $Key =head2 Values =head3 $Boolean =head3 $Escape =head3 $StringLiteral =head3 $MultiLineStringLiteral =head3 $BasicString =head3 $MultiLineString =head3 $String =head3 $Date =head3 $Time =head3 $DateTime =head3 $Hex =head3 $Oct =head3 $Bin =head3 $Dec =head3 $Integer =head3 $Float =head2 $SpecialFloat =head1 AUTHOR Jeff Ober =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2025 by Jeff Ober. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut TOML-Tiny-0.20/Changes0000644000175000017500000001042314770631453013060 0ustar olafolaf0.20 2025-03-25 - Fix parsing of quoted keys (GH#41) (Ian Jackson) - Fix writing of more kinds of quote-needing keys (GH#40) (Ian Jackson) - Avoid looking at string values to try to find the type (GH#37) (Ian Jackson) - die if data to be encoded is not a hashref (GH#36) (djerius) - inline table keys were not normalized via to_toml_key() (GH#35) (djerius) 0.19 2025-02-11 - trap and die on undefined values (GH#32) (djerius) 0.18 2024-09-04 - Support builtin booleans (GH#31) (Tina Mller (tinita)) 0.17 2024-06-03 - regexp for values which match a DateTime should be anchored to start and end of string (GH#30) (djerius) 0.16 2023-05-31 - Remove when (GH#25) (Olaf Alders) - Test strict mode in to_toml_array() (GH#26) (Olaf Alders) - Replace @Author::BLUEFEET with equivalent config (GH#23) (Olaf Alders) - Make some imports explicit (GH#19) (Olaf Alders) 0.15 2021-08-13 - bugfix: strings with "inf" or "nan" in them no longer treated as special floats 0.14 2021-08-02 - Fix an issue with serialisation of nan, inf, and -inf (thanks jjatria) - Enforcement of homogenous arrays is no longer supported as it has been dropped from the TOML spec - strict_arrays is now strict (strict_arrays still accepted for compatibility) - strict mode now disallows trailing commas - bugfix: table names whose individual segments include a dot can no longer cause parser to incorrectly identify duplicate table names - bugfix: correctly fail on arrays without separators - bugfix: correctly fail when array ends without closing at EOF - bugfix: correctly fail when inline table is missing separators or has trailing separator - bugfix: disallow non-permitted control characters in strings and comments - bugfix: disallow invalid unicode in input - bugfix: allow double-zero exponents (e00) - bugfix: correctly parse multi-line literal strings, dealing properly with some edge cases - bugfix: correctly parse multi-line basic strings, dealing properly with some edge cases - bugfix: correctly escape unicode control characters in toml output - bugfix: correctly handle comment-like sequences in multiline strings - bugfix: correctly handle keys with names that are toml keywords - bugfix: better handling of inf/nan in parsing, writing - bugfix: correctly generate empty inline tables within arrays - bugfix: make duplicate key enforcement match the toml 1.0 spec - bugfix: update datetime support to match toml abnf, w/ workaround for burntsushi tests supporting lowercase z and toml supporting a space instead of T - bugfix: fix support for local dates, local times, fractional second precision - bugfix: fix parsing of dotted keys in inline tables - bugfix: fixes for escapes and unicode in key names, both in parsing and generating toml 0.13 2021-07-26 -Fix a spurious warning being raised on trailing spaces in hexadecimal numbers (thanks jjatria) 0.12 2021-05-28 -Fix bug causing to_toml to incorrectly dereference \1 and \0 (thanks oschwald) 0.11 2021-02-12 -Fix bug in strict_arrays where string containing integer is recognized as an integer, causing parsing to fail when present in an array containing other strings 0.10 2020-09-08 -Remove dependency on DateTime::Format::RFC3339 0.09 2020-08-11 -Fix warning when calling `to_toml(from_toml(...))` -Fix bug allowing perl to stringify numbers (thanks oschwald) -Fix bug disallowing weird forms of nan (+nan, -nan) -Behavior change: return Math::Big(Int|Float) for large numbers (thanks oschwald) 0.08 2020-06-25 -Fix bug in TOML table output generation (thanks ijackson) 0.07 2020-05-08 -Add support for floating time zones in TOML output (thanks ijackson) -Fix bug where datetimes were being outputed as ISO8601 instead of RFC3339 -Clarified documentation with explicit description of supported perl types for each toml type 0.06 2020-03-30 -Performance improvements in TOML::Tiny::Tokenizer->next_token -Fix totally broken OO interface (thanks noctux) 0.05 2020-01-21 -POD fixes for TOML::Tiny::Grammar 0.04 2020-01-21 -Remove superfluous dependency on DateTime::Format::RFC3339, which was only needed for unit tests 0.03 2020-01-18 -Remove automatic inflation of numerical types using Math::Big(Int|Float); this may now be done with inflate_integer and inflate_float 0.02 2020-01-17 -Add MANIFEST.SKIP to prevent dzil from including author scripts 0.01 2020-01-17 -Initial release