TOML-Tiny-0.16000755000765000024 014435630525 12350 5ustar00olafstaff000000000000README100644000765000024 56614435630525 13300 0ustar00olafstaff000000000000TOML-Tiny-0.16This archive contains the distribution TOML-Tiny, version 0.16: a minimal, pure perl TOML parser and serializer This software is copyright (c) 2023 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.030. Changes100644000765000024 723714435630525 13735 0ustar00olafstaff000000000000TOML-Tiny-0.160.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 LICENSE100644000765000024 4363714435630525 13473 0ustar00olafstaff000000000000TOML-Tiny-0.16This software is copyright (c) 2023 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) 2023 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 Artistic License 1.0 --- This software is Copyright (c) 2023 by Jeff Ober. This is free software, licensed under: The 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. - "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 ftp.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) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting 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. 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 whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. 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 cpanfile100644000765000024 112514435630525 14134 0ustar00olafstaff000000000000TOML-Tiny-0.16requires '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'; }; dist.ini100644000765000024 65114435630525 14057 0ustar00olafstaff000000000000TOML-Tiny-0.16name = 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] META.yml100644000765000024 206514435630525 13705 0ustar00olafstaff000000000000TOML-Tiny-0.16--- 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.030, 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.16' x_generated_by_perl: v5.36.0 x_serialization_backend: 'YAML::Tiny version 1.74' x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' MANIFEST100644000765000024 6035214435630525 13610 0ustar00olafstaff000000000000TOML-Tiny-0.16# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.030. 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/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 META.json100644000765000024 400414435630525 14050 0ustar00olafstaff000000000000TOML-Tiny-0.16{ "abstract" : "a minimal, pure perl TOML parser and serializer", "author" : [ "Jeff Ober " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.030, 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.16", "x_generated_by_perl" : "v5.36.0", "x_serialization_backend" : "Cpanel::JSON::XS version 4.36", "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later" } Dockerfile100644000765000024 30414435630525 14400 0ustar00olafstaff000000000000TOML-Tiny-0.16FROM 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 t000755000765000024 014435630525 12534 5ustar00olafstaff000000000000TOML-Tiny-0.16parser.t100644000765000024 161614435630525 14361 0ustar00olafstaff000000000000TOML-Tiny-0.16/tuse strict; use warnings; use Test2::V0; use TOML::Tiny; 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'; }; }; done_testing; writer.t100644000765000024 634314435630525 14403 0ustar00olafstaff000000000000TOML-Tiny-0.16/tuse 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 '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" ] [[products]] name = "Hammer" sku = 738594937 [[products]] [[products]] name = "Nail" sku = 284758393 color = "gray" parity.t100644000765000024 430614435630525 14374 0ustar00olafstaff000000000000TOML-Tiny-0.16/t#------------------------------------------------------------------------------- # 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" numbers.t100644000765000024 1011714435630525 14554 0ustar00olafstaff000000000000TOML-Tiny-0.16/tuse 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; Makefile.PL100644000765000024 436114435630525 14407 0ustar00olafstaff000000000000TOML-Tiny-0.16# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.030. 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.16", "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); MANIFEST.SKIP100644000765000024 3214435630525 14262 0ustar00olafstaff000000000000TOML-Tiny-0.16scratch.pl build-tests.pl perlimports.toml100644000765000024 211214435630525 15702 0ustar00olafstaff000000000000TOML-Tiny-0.16# 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 TOML000755000765000024 014435630525 13612 5ustar00olafstaff000000000000TOML-Tiny-0.16/libTiny.pm100644000765000024 2504614435630525 15262 0ustar00olafstaff000000000000TOML-Tiny-0.16/lib/TOMLpackage TOML::Tiny; # ABSTRACT: a minimal, pure perl TOML parser and serializer $TOML::Tiny::VERSION = '0.16'; 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}); } #------------------------------------------------------------------------------- # 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.16 =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) 2023 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 strict_arrays.t100644000765000024 44414435630525 15734 0ustar00olafstaff000000000000TOML-Tiny-0.16/tuse 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; Tiny000755000765000024 014435630525 14535 5ustar00olafstaff000000000000TOML-Tiny-0.16/lib/TOMLUtil.pm100644000765000024 302314435630525 16146 0ustar00olafstaff000000000000TOML-Tiny-0.16/lib/TOML/Tinypackage TOML::Tiny::Util; # ABSTRACT: utility functions used by TOML::Tiny $TOML::Tiny::Util::VERSION = '0.16'; 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.16 =head1 AUTHOR Jeff Ober =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2023 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 author-pod-syntax.t100644000765000024 45414435630525 16452 0ustar00olafstaff000000000000TOML-Tiny-0.16/t#!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(); 00-report-prereqs.t100644000765000024 1360114435630525 16311 0ustar00olafstaff000000000000TOML-Tiny-0.16/t#!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: 00-report-prereqs.dd100644000765000024 353514435630525 16422 0ustar00olafstaff000000000000TOML-Tiny-0.16/tdo { 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; }Writer.pm100644000765000024 1555414435630525 16541 0ustar00olafstaff000000000000TOML-Tiny-0.16/lib/TOML/Tinypackage TOML::Tiny::Writer; $TOML::Tiny::Writer::VERSION = '0.16'; 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); my @KEYS; sub to_toml { my $data = shift; my $param = ref($_[1]) eq 'HASH' ? $_[1] : undef; 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 '') { # 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 $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 $key (keys %$data) { my $value = $data->{$key}; if (ref $value eq 'HASH') { push @buff, $key . '=' . to_toml_inline_table($value); } else { push @buff, $key . '=' . to_toml($value); } } 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($_); } 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; } # Escape control characters $str =~ s/([\p{General_Category=Control}])/'\\u00' . unpack('H2', $1)/eg; # Escape unicode characters #$str =~ s/($NonASCII)/'\\u00' . unpack('H2', $1)/eg; if ($str =~ /^"/) { return qq{'$str'}; } else { return qq{"$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.16 =head1 AUTHOR Jeff Ober =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2023 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 Parser.pm100644000765000024 3115714435630525 16516 0ustar00olafstaff000000000000TOML-Tiny-0.16/lib/TOML/Tinypackage TOML::Tiny::Parser; # ABSTRACT: parser used by TOML::Tiny $TOML::Tiny::Parser::VERSION = '0.16'; 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(".%06d%s", $1 * 1000000, $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.16 =head1 AUTHOR Jeff Ober =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2023 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 Grammar.pm100644000765000024 1675314435630525 16655 0ustar00olafstaff000000000000TOML-Tiny-0.16/lib/TOML/Tinypackage TOML::Tiny::Grammar; # ABSTRACT: exports regex definitions used to parse TOML source $TOML::Tiny::Grammar::VERSION = '0.16'; 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.16 =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) 2023 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 Tokenizer.pm100644000765000024 1412614435630525 17231 0ustar00olafstaff000000000000TOML-Tiny-0.16/lib/TOML/Tinypackage TOML::Tiny::Tokenizer; # ABSTRACT: tokenizer used by TOML::Tiny $TOML::Tiny::Tokenizer::VERSION = '0.16'; 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 =~ s/^["']//; $seg =~ s/["']$//; $seg = $self->unescape_str($seg); 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.16 =head1 AUTHOR Jeff Ober =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2023 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 valid000755000765000024 014435630525 15563 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-testexample.t100644000765000024 1402114435630525 17561 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid# 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; key000755000765000024 014435630525 16353 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/validspace.t100644000765000024 444514435630525 20002 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/key# 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;empty.t100644000765000024 235214435630525 20040 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/key# 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;bool000755000765000024 014435630525 16516 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/validbool.t100644000765000024 237614435630525 20006 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/bool# 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/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); }; done_testing;string000755000765000024 014435630525 17071 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/validnl.t100644000765000024 263014435630525 20030 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/string# 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;empty-file.t100644000765000024 230314435630525 20161 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid# 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;newline-lf.t100644000765000024 242114435630525 20147 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid# 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;example.toml100644000765000024 13314435630525 20230 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/validbest-day-ever = 1987-07-05T17:45:00Z [numtheory] boring = false perfection = [6, 28, 496] array000755000765000024 014435630525 16701 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/validbool.t100644000765000024 246614435630525 20171 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/array# 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;dotted.t100644000765000024 7027414435630525 20215 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/key# 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;float000755000765000024 014435630525 16670 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/validlong.t100644000765000024 715514435630525 20164 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/float# 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;zero.t100644000765000024 2140014435630525 20211 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/float# 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;raw.t100644000765000024 332214435630525 20207 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/string# 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;key000755000765000024 014435630525 16702 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalidhash.t100644000765000024 62714435630525 20137 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;empty.t100644000765000024 300414435630525 20361 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/array# 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;array.t100644000765000024 2615414435630525 20374 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/array# 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;numeric.t100644000765000024 441314435630525 20344 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/key# 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;escapes.t100644000765000024 311714435630525 20325 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/key# 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;table000755000765000024 014435630525 16652 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/validempty.t100644000765000024 235614435630525 20343 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table# 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;names.t100644000765000024 415314435630525 20305 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table# 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;float.t100644000765000024 1350014435630525 20341 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/float# 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;space.t100644000765000024 63114435630525 20302 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;empty.t100644000765000024 63114435630525 20345 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;newline-crlf.t100644000765000024 243214435630525 20476 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid# 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;nested.t100644000765000024 270614435630525 20515 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/array# 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;alphanum.t100644000765000024 1011014435630525 20516 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/key# 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;empty.toml100644000765000024 1514435630525 20502 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/key"" = "blank" space.toml100644000765000024 1214435630525 20434 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/key"a b" = 1 no-eol.t100644000765000024 236614435630525 20377 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table# 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;bool.toml100644000765000024 2314435630525 20441 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/boolt = true f = false integer000755000765000024 014435630525 17220 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/validlong.t100644000765000024 734414435630525 20514 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/integer# 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;zero.t100644000765000024 3407014435630525 20550 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/integer# 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;empty.t100644000765000024 236714435630525 20564 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/string# 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;nl.toml100644000765000024 16314435630525 20517 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/stringnl_mid = "val\nue" nl_end = """value\n""" lit_nl_end = '''value\n''' lit_nl_mid = 'val\nue' lit_nl_uni = 'val\ue' no-eol.t100644000765000024 63314435630525 20402 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;escape.t100644000765000024 63314435630525 20451 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;empty-file.toml100644000765000024 014435630525 20601 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/validnewline-lf.toml100644000765000024 3314435630525 20614 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/validos = "unix" newline = "lf" strings.t100644000765000024 273014435630525 20721 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/array# 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;bool.toml100644000765000024 2214435630525 20623 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/arraya = [true, false] dotted.toml100644000765000024 102714435630525 20673 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/key# 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 keyword.t100644000765000024 251714435630525 20670 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table# 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;long.toml100644000765000024 7214435630525 20623 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/floatlongpi = 3.141592653589793 neglongpi = -3.141592653589793 zero.toml100644000765000024 10414435630525 20657 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/floatf1 = 0.0 f2 = +0.0 f3 = -0.0 f4 = 0e0 f5 = 0e00 f6 = +0e0 f7 = -0e0 simple.t100644000765000024 243614435630525 20714 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/string# 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;raw.toml100644000765000024 56514435630525 20705 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/stringbackspace = '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.' newline.t100644000765000024 63514435630525 20654 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;hash.toml100644000765000024 714435630525 20577 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/keya# = 1 table000755000765000024 014435630525 17201 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalidempty.t100644000765000024 63514435630525 20650 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# 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;spec-example-1.t100644000765000024 2663414435630525 20664 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid# 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;empty.toml100644000765000024 2514435630525 21031 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/arraythevoid = [[[[[]]]]] nospaces.t100644000765000024 1127214435630525 21064 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/array# 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;array.toml100644000765000024 31514435630525 21033 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/arrayints = [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 ] datetime000755000765000024 014435630525 17357 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/validlocal.t100644000765000024 256714435630525 21010 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/datetime# 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;comment000755000765000024 014435630525 17225 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/validat-eof.t100644000765000024 240114435630525 20722 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/comment# 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;tricky.t100644000765000024 3326414435630525 21107 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/comment# 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;numeric.toml100644000765000024 614435630525 20766 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/key1 = 1 escapes.toml100644000765000024 22514435630525 21012 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/key"\n" = "newline" "\u00c0" = "latin capital letter A with grave" "\"" = "just a quote" ["backsp\b\b"] ["\"quoted\""] quote = true ["a.b"."\u00c0"] names.toml100644000765000024 13214435630525 20766 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table[a.b.c] [a."b.c"] [a.'d.e'] [a.' x '] [ d.e.f ] [ g . h . i ] [ j . "Êž" . 'l' ] [x.1.2] empty.toml100644000765000024 414435630525 20757 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table[a] float.toml100644000765000024 7314435630525 20772 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/floatpi = 3.14 pospi = +3.14 negpi = -3.14 zero-intpart = 0.123 exponent.t100644000765000024 2473214435630525 21105 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/float# 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;escapes.t100644000765000024 431414435630525 21043 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/string# 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;empty.toml100644000765000024 514435630525 21010 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key = 1 space.toml100644000765000024 1014435630525 20761 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/keya b = 1 implicit-groups.t100644000765000024 600314435630525 21236 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid# 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;newline-crlf.toml100644000765000024 3614435630525 21144 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/validos = "DOS" newline = "crlf" nested.toml100644000765000024 2614435630525 21156 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/arraynest = [["a"], ["b"]] at-eof2.t100644000765000024 240514435630525 21010 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/comment# 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;alphanum.toml100644000765000024 25514435630525 21177 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/keyalpha = "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 quoted-dots.t100644000765000024 2370414435630525 21176 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/key# 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;array-one.t100644000765000024 272114435630525 21076 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table# 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;sub-empty.t100644000765000024 246714435630525 21135 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table# 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;no-eol.toml100644000765000024 1014435630525 21027 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table[table] long.toml100644000765000024 10514435630525 21170 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/integerint64-max = 9223372036854775807 int64-max-neg = -9223372036854775808 zero.toml100644000765000024 17214435630525 21214 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/integerd1 = 0 d2 = +0 d3 = -0 h1 = 0x0 h2 = 0x00 h3 = 0x00000 o1 = 0o0 a2 = 0o00 a3 = 0o00000 b1 = 0b0 b2 = 0b00 b3 = 0b00000 integer.t100644000765000024 1354014435630525 21225 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/integer# 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;empty.toml100644000765000024 1414435630525 21217 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/stringanswer = "" datetime000755000765000024 014435630525 17706 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalidno-t.t100644000765000024 64114435630525 21071 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/datetime# 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;duplicate.t100644000765000024 64114435630525 21162 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;no-eol.toml100644000765000024 1414435630525 21063 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/keya = 1 b = 2 escape.toml100644000765000024 5514435630525 21137 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key\u00c0 = "latin capital letter A with grave" multiline.t100644000765000024 64114435630525 21212 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;llbrace.t100644000765000024 64114435630525 21113 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# 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;rrbrace.t100644000765000024 64114435630525 21127 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# 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;strings.toml100644000765000024 10314435630525 21401 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/arraystring_array = [ "all", 'strings', """are the same""", '''type'''] special-word.t100644000765000024 701414435630525 21273 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/key# 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;array-many.t100644000765000024 345614435630525 21267 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table# 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;whitespace.t100644000765000024 241214435630525 21332 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table# 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;keyword.toml100644000765000024 4014435630525 21325 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table[true] [false] [inf] [nan] array-nest.t100644000765000024 454114435630525 21270 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table# 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;with-pound.t100644000765000024 532714435630525 21304 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table# 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;underscore.t100644000765000024 1133714435630525 21413 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/float# 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;literals.t100644000765000024 2636414435630525 21417 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/integer# 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;simple.toml100644000765000024 5714435630525 21361 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/stringanswer = "You are not drinking enough whisky." array000755000765000024 014435630525 17230 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalidtables-1.t100644000765000024 64314435630525 21150 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/array# 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;tables-2.t100644000765000024 64314435630525 21151 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/array# 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;no-close.t100644000765000024 64314435630525 21257 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/array# 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;encoding000755000765000024 014435630525 17700 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalidutf16.t100644000765000024 64314435630525 21155 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/encoding# 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;two-equals.t100644000765000024 64314435630525 21313 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;newline.toml100644000765000024 2114435630525 21331 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/keybarekey = 123 empty.toml100644000765000024 314435630525 21305 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table[] redefine.t100644000765000024 64314435630525 21272 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# 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;spec-example-1.toml100644000765000024 105714435630525 21344 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid# 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" ] nospaces.toml100644000765000024 1714435630525 21507 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/arrayints = [1,2,3] timezone.t100644000765000024 267514435630525 21550 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/datetime# 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;datetime.t100644000765000024 252014435630525 21477 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/datetime# 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;local.toml100644000765000024 13014435630525 21460 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/datetimelocal = 1987-07-05T17:45:00 milli = 1977-12-21T10:32:00.555 space = 1987-07-05 17:45:00 at-eof.toml100644000765000024 12514435630525 21413 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/comment# This is a full-line comment key = "value" # This is a comment at the end of a line tricky.toml100644000765000024 60114435630525 21544 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/comment[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 = { "#" = '}#'}#}} inline-table000755000765000024 014435630525 20126 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/validbool.t100644000765000024 254014435630525 21407 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/inline-table# 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;nest.t100644000765000024 3024214435630525 21445 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/inline-table# 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;special-chars.t100644000765000024 560714435630525 21426 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/key# 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;inf-and-nan.t100644000765000024 1760614435630525 21335 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/float# 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;exponent.toml100644000765000024 16214435630525 21544 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/floatlower = 3e2 upper = 3E2 neg = 3e-2 pos = 3E+2 zero = 3e0 pointlower = 3.1e2 pointupper = 3.1E2 minustenth = -1E-1 with-pound.t100644000765000024 255414435630525 21522 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/string# 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;escapes.toml100644000765000024 140314435630525 21547 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/stringbackspace = "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." two-equals3.t100644000765000024 64514435630525 21400 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;after-value.t100644000765000024 64514435630525 21427 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;after-table.t100644000765000024 64514435630525 21402 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;two-equals2.t100644000765000024 64514435630525 21377 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;after-array.t100644000765000024 64514435630525 21431 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;duplicate.t100644000765000024 64514435630525 21465 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# 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;bool000755000765000024 014435630525 17045 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalidmixed-case.t100644000765000024 64514435630525 21376 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/bool# 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;string000755000765000024 014435630525 17420 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalidno-close.t100644000765000024 64514435630525 21451 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;implicit-groups.toml100644000765000024 2414435630525 21703 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid[a.b.c] answer = 42 hetergeneous.t100644000765000024 1446614435630525 21756 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/array# 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;at-eof2.toml100644000765000024 12514435630525 21475 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/comment# This is a full-line comment key = "value" # This is a comment at the end of a line everywhere.t100644000765000024 1277114435630525 21767 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/comment# 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;empty.t100644000765000024 1223514435630525 21634 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/inline-table# 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;array.t100644000765000024 346614435630525 21602 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/inline-table# 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;quoted-dots.toml100644000765000024 16014435630525 21635 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/keyplain = 1 "with.dot" = 2 [plain_table] plain = 3 "with.dot" = 4 [table.withdot] plain = 5 "key.with.dots" = 6 case-sensitive.t100644000765000024 344314435630525 21626 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/key# 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;numeric-dotted.t100644000765000024 476014435630525 21632 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/key# 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;equals-nospace.t100644000765000024 457614435630525 21634 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/key# 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;sub-empty.toml100644000765000024 1214435630525 21565 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table[a] [a.b] array-one.toml100644000765000024 7214435630525 21543 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table[[people]] first_name = "Bruce" last_name = "Springsteen" underscore.t100644000765000024 663514435630525 21730 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/integer# 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;integer.toml100644000765000024 6514435630525 21653 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/integeranswer = 42 posanswer = +42 neganswer = -42 zero = 0 no-close-2.t100644000765000024 64714435630525 21422 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/array# 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;no-secs.t100644000765000024 64714435630525 21571 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/datetime# 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;no-t.toml100644000765000024 3314435630525 21554 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/datetimeno-t = 1987-07-0517:45:00Z multiline.toml100644000765000024 2314435630525 21674 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key"""long key""" = 1 duplicate.toml100644000765000024 5714435630525 21653 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# DO NOT DO THIS name = "Tom" name = "Pradyun" open-bracket.t100644000765000024 64714435630525 21570 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;whitespace.t100644000765000024 64714435630525 21651 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# 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;llbrace.toml100644000765000024 1314435630525 21574 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table[ [table]] rrbrace.toml100644000765000024 1314435630525 21610 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table[[table] ] with-pound.t100644000765000024 64714435630525 21613 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# 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;float000755000765000024 014435630525 17217 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalidleading-us.t100644000765000024 64714435630525 21563 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;control000755000765000024 014435630525 17572 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalidmulti-us.t100644000765000024 64714435630525 21665 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;multi-lf.t100644000765000024 64714435630525 21637 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;nested-double.t100644000765000024 1233014435630525 21777 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/array# 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;local-time.t100644000765000024 252214435630525 21733 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/datetime# 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;local-date.t100644000765000024 244214435630525 21713 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/datetime# 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;special-word.toml100644000765000024 11114435630525 21752 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/keyfalse = false true = 1 inf = 100000000 nan = "ceci n'est pas un nombre" with-pound.toml100644000765000024 3214435630525 21740 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table["key#group"] answer = 42 array-many.toml100644000765000024 24314435630525 21746 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table[[people]] first_name = "Bruce" last_name = "Springsteen" [[people]] first_name = "Eric" last_name = "Clapton" [[people]] first_name = "Bob" last_name = "Seger" whitespace.toml100644000765000024 1614435630525 22000 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table["valid key"] without-super.t100644000765000024 275714435630525 22051 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table# 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;array-nest.toml100644000765000024 40614435630525 21754 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table[[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" underscore.toml100644000765000024 7014435630525 22033 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/floatbefore = 3_141.5927 after = 3141.592_7 exponent = 3e1_4 literals.toml100644000765000024 22714435630525 22055 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/integerbin1 = 0b11010110 bin2 = 0b1_0_1 oct1 = 0o01234567 oct2 = 0o755 oct3 = 0o7_6_5 hex1 = 0xDEADBEEF hex2 = 0xdeadbeef hex3 = 0xdead_beef hex4 = 0x00987 tables-2.toml100644000765000024 27414435630525 21661 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/array# INVALID TOML DOC [[fruit]] name = "apple" [[fruit.variety]] name = "red delicious" # This table conflicts with the previous table [fruit.variety] name = "granny smith" no-close.toml100644000765000024 2714435630525 21743 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/arraylong_array = [ 1, 2, 3 tables-1.toml100644000765000024 6714435630525 21640 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/array# INVALID TOML DOC fruit = [] [[fruit]] # Not allowed no-leads.t100644000765000024 65114435630525 21717 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/datetime# 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;utf16.toml100644000765000024 5214435630525 21637 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/encoding# UTF-16 without BOM two-equals.toml100644000765000024 1114435630525 21770 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/keykey= = 1 start-bracket.t100644000765000024 65114435630525 21757 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;redefine.toml100644000765000024 11614435630525 21775 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# Define b as int, and try to use it as a table: error [a] b = 1 [a.b] c = 2 equals-sign.t100644000765000024 65114435630525 21740 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# 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;array-empty.t100644000765000024 65114435630525 21762 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# 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;trailing-us.t100644000765000024 65114435630525 21764 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;exp-point-1.t100644000765000024 65114435630525 21607 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;exp-point-2.t100644000765000024 65114435630525 21610 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;integer000755000765000024 014435630525 17547 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invaliddouble-us.t100644000765000024 65114435630525 21755 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;bad-escape.t100644000765000024 65114435630525 21713 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;bad-concat.t100644000765000024 65114435630525 21722 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;string-us.t100644000765000024 65114435630525 22034 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;string-lf.t100644000765000024 65114435630525 22006 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;string-bs.t100644000765000024 65114435630525 22011 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;multi-del.t100644000765000024 65114435630525 21775 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;timezone.toml100644000765000024 20614435630525 22224 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/datetimeutc = 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 datetime.toml100644000765000024 7214435630525 22147 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/datetimespace = 1987-07-05 17:45:00Z lower = 1987-07-05t17:45:00z nest.toml100644000765000024 56414435630525 22121 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/inline-tabletbl_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 } ] ] bool.toml100644000765000024 3214435630525 22051 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/inline-tablea = {a = true, b = false} special-chars.toml100644000765000024 5214435630525 22063 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/key"~!@$^&*()_+-`1234567890[]|/?><.,;:'" = 1 array-implicit.t100644000765000024 304214435630525 22124 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table# 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;inf-and-nan.toml100644000765000024 35014435630525 21771 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/float# 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 with-pound.toml100644000765000024 16114435630525 22202 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/stringpound = "We see no # comments here." poundcomment = "But there are # some comments here." # Did I # mess you up? raw-multiline.t100644000765000024 275214435630525 22215 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/string# 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;escape-tricky.t100644000765000024 326014435630525 22162 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/string# 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;inline-table000755000765000024 014435630525 20455 5ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalidempty.t100644000765000024 65314435630525 22124 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/inline-table# 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;utf16-bom.t100644000765000024 65314435630525 21731 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/encoding# 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;after-table.toml100644000765000024 4414435630525 22063 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key[error] this = "should not be here" partial-quoted.t100644000765000024 65314435630525 22146 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;duplicate-keys.t100644000765000024 65314435630525 22136 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;after-value.toml100644000765000024 6014435630525 22106 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/keyfirst = "Tom" last = "Preston-Werner" # INVALID two-equals3.toml100644000765000024 614435630525 22037 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/keya=b=1 after-array.toml100644000765000024 4014435630525 22106 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key[[agencies]] owner = "S Cjelli" two-equals2.toml100644000765000024 514435630525 22035 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/keya==1 duplicate.toml100644000765000024 2514435630525 22145 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table[a] b = 1 [a] c = 2 leading-zero.t100644000765000024 65314435630525 22110 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;mixed-case.toml100644000765000024 1614435630525 22056 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/boolvalid = False leading-us.t100644000765000024 65314435630525 22110 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;bad-uni-esc.t100644000765000024 65314435630525 22020 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;no-close.toml100644000765000024 5214435630525 22131 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringno-ending-quote = "One time, at band camp wrong-close.t100644000765000024 65314435630525 22170 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;comment-lf.t100644000765000024 65314435630525 22144 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;string-del.t100644000765000024 65314435630525 22153 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;comment-us.t100644000765000024 65314435630525 22172 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;multi-null.t100644000765000024 65314435630525 22205 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;mixed-int-array.t100644000765000024 544314435630525 22246 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/array# 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;mixed-int-float.t100644000765000024 774214435630525 22241 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/array# 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;hetergeneous.toml100644000765000024 5114435630525 22367 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/arraymixed = [[1, 2], ["a", "b"], [1.1, 2.1]] milliseconds.t100644000765000024 275014435630525 22375 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/datetime# 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.123456Z", "utc2" => "1987-07-05T17:45:56.600000Z", "wita1" => "1987-07-05T17:45:56.123456+08:00", "wita2" => "1987-07-05T17:45:56.600000+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;everywhere.toml100644000765000024 105414435630525 22447 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/comment# 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 empty.toml100644000765000024 23514435630525 22301 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/inline-tableempty1 = {} empty2 = { } empty_in_array = [ { not_empty = 1 }, {} ] empty_in_array2 = [{},{not_empty=1}] many_empty = [{},{},{}] nested_empty = {"empty"={}} array.toml100644000765000024 25214435630525 22260 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/inline-tablepeople = [{first_name = "Bruce", last_name = "Springsteen"}, {first_name = "Eric", last_name = "Clapton"}, {first_name = "Bob", last_name = "Seger"}] case-sensitive.toml100644000765000024 31314435630525 22307 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/keysectioN = "NN" [section] name = "lower" NAME = "upper" Name = "capitalized" [Section] name = "different section!!" "μ" = "greek small letter mu" "Μ" = "greek capital letter MU" M = "latin letter M" numeric-dotted.toml100644000765000024 1014435630525 22262 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/key1.2 = 3 equals-nospace.toml100644000765000024 1214435630525 22261 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/keyanswer=42 underscore.toml100644000765000024 3114435630525 22360 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/integerkilo = 1_000 x = 1_1_1_1 unicode-escape.t100644000765000024 251214435630525 22302 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/string# 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;escaped-escape.t100644000765000024 244014435630525 22260 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/string# 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;no-close-2.toml100644000765000024 1214435630525 22074 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/arrayx = [42 # text-in-array.t100644000765000024 65514435630525 22247 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/array# 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;trailing-t.t100644000765000024 65514435630525 22273 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/datetime# 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;no-secs.toml100644000765000024 3414435630525 22247 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/datetimeno-secs = 1987-07-05T17:45Z without-value-1.t100644000765000024 65514435630525 22170 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;open-bracket.toml100644000765000024 1114435630525 22241 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key[abc = 1 without-value-2.t100644000765000024 65514435630525 22171 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;with-pound.toml100644000765000024 3014435630525 22265 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table[key#group] answer = 42 whitespace.toml100644000765000024 1614435630525 22327 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table[invalid key] leading-us.toml100644000765000024 2214435630525 22236 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatleading-us = _1.2 exp-double-us.t100644000765000024 65514435630525 22223 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;leading-point.t100644000765000024 65514435630525 22264 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;capital-hex.t100644000765000024 65514435630525 22261 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;trailing-us.t100644000765000024 65514435630525 22320 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;capital-bin.t100644000765000024 65514435630525 22245 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;capital-oct.t100644000765000024 65514435630525 22262 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;invalid-bin.t100644000765000024 65514435630525 22256 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;invalid-oct.t100644000765000024 65514435630525 22273 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;invalid-hex.t100644000765000024 65514435630525 22272 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;string-null.t100644000765000024 65514435630525 22363 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;multi-us.toml100644000765000024 2714435630525 22345 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlmulti-us = """null""" multi-lf.toml100644000765000024 2714435630525 22317 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlmulti-lf = """null""" rawmulti-us.t100644000765000024 65514435630525 22376 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;comment-del.t100644000765000024 65514435630525 22311 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;rawmulti-lf.t100644000765000024 65514435630525 22350 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;spec-example-1-compact.t100644000765000024 2667414435630525 22314 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid# 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;nested-double.toml100644000765000024 5014435630525 22423 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/arraynest = [ [ ["a"], [1, 2, [3]] ] ] mixed-int-string.t100644000765000024 532514435630525 22435 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/array# 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;local-date.toml100644000765000024 3114435630525 22353 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/datetimebestdayever = 1987-07-05 local-time.toml100644000765000024 6414435630525 22402 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/datetimebesttimeever = 17:45:00 milliseconds = 10:32:00.555 multiline.t100644000765000024 1037614435630525 22504 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/inline-table# 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;without-super.toml100644000765000024 17014435630525 22524 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table# [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 unicode-literal.t100644000765000024 244614435630525 22504 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/string# 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;no-close-table.t100644000765000024 65714435630525 22351 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/array# 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;no-leads.toml100644000765000024 3714435630525 22405 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/datetimeno-leads = 1987-7-05T17:45:00Z start-bracket.toml100644000765000024 2114435630525 22436 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key[a] [xyz = 5 [b] array-empty.toml100644000765000024 3214435630525 22443 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table[[]] name = "Born to Run" equals-sign.toml100644000765000024 1314435630525 22420 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table[name=bad] array-implicit.t100644000765000024 65714435630525 22444 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# 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;trailing-us.toml100644000765000024 2314435630525 22445 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floattrailing-us = 1.2_ nan_underscore.t100644000765000024 65714435630525 22541 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;inf_underscore.t100644000765000024 65714435630525 22541 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;exp-leading-us.t100644000765000024 65714435630525 22356 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;exp-point-2.toml100644000765000024 2314435630525 22271 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatexp-point-2 = 1.e2 us-after-point.t100644000765000024 65714435630525 22411 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;exp-point-1.toml100644000765000024 2414435630525 22271 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatexp-point-1 = 1e2.3 exp-double-e-2.t100644000765000024 65714435630525 22161 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;double-point-1.t100644000765000024 65714435630525 22273 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;trailing-point.t100644000765000024 65714435630525 22474 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;exp-double-e-1.t100644000765000024 65714435630525 22160 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;double-point-2.t100644000765000024 65714435630525 22274 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;wrong-case-true.t100644000765000024 65714435630525 22404 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/bool# 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;positive-hex.t100644000765000024 65714435630525 22510 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;double-us.toml100644000765000024 2214435630525 22435 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integerdouble-us = 1__23 us-after-hex.t100644000765000024 65714435630525 22374 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;us-after-oct.t100644000765000024 65714435630525 22375 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;us-after-bin.t100644000765000024 65714435630525 22360 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;positive-bin.t100644000765000024 65714435630525 22474 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;positive-oct.t100644000765000024 65714435630525 22511 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;negative-bin.t100644000765000024 65714435630525 22434 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;negative-oct.t100644000765000024 65714435630525 22451 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;negative-hex.t100644000765000024 65714435630525 22450 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;bad-concat.toml100644000765000024 3514435630525 22406 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringno_concat = "first" "second" bad-escape.toml100644000765000024 7614435630525 22404 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringinvalid-escape = "This string has a bad \a escape character." bad-codepoint.t100644000765000024 65714435630525 22445 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;bad-multiline.t100644000765000024 65714435630525 22463 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;rawstring-us.t100644000765000024 65714435630525 22554 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;rawmulti-del.t100644000765000024 65714435630525 22515 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;string-bs.toml100644000765000024 3114435630525 22471 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlstring-bs = "backspace" multi-del.toml100644000765000024 3014435630525 22454 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlmulti-del = """null""" rawstring-lf.t100644000765000024 65714435630525 22526 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;comment-null.t100644000765000024 65714435630525 22521 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;string-us.toml100644000765000024 2414435630525 22516 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlstring-us = "null" string-lf.toml100644000765000024 2414435630525 22470 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlstring-lf = "null" string-with-comma.t100644000765000024 263514435630525 22605 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/array# 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;key-dotted.t100644000765000024 7002614435630525 22551 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/inline-table# 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;array-table-array.t100644000765000024 356414435630525 22526 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table# 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;array-implicit.toml100644000765000024 4514435630525 22574 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table[[albums.songs]] name = "Glory Days" raw-multiline.toml100644000765000024 30314435630525 22673 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/stringoneline = '''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.''' escape-tricky.toml100644000765000024 51014435630525 22645 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/stringend_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\''' multiline-quotes.t100644000765000024 333514435630525 22742 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/string# 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;empty.toml100644000765000024 1014435630525 22577 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/inline-tablet = {,} no-comma.t100644000765000024 66114435630525 22473 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/inline-table# 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;utf16-bom.toml100644000765000024 4614435630525 22415 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/encodingþÿ# UTF-16 with BOM special-character.t100644000765000024 66114435630525 22564 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;partial-quoted.toml100644000765000024 2414435630525 22626 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/keypartial"quoted" = 5 duplicate-keys.toml100644000765000024 3114435630525 22614 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/keydupe = false dupe = true quoted-no-close.t100644000765000024 66114435630525 22527 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# 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;exp-trailing-us.t100644000765000024 66114435630525 22557 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;leading-zero.toml100644000765000024 2514435630525 22571 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatleading-zero = 03.14 us-before-point.t100644000765000024 66114435630525 22545 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;wrong-case-false.t100644000765000024 66114435630525 22512 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/bool# 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;leading-us.toml100644000765000024 2214435630525 22566 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integerleading-us = _123 wrong-close.toml100644000765000024 4714435630525 22655 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringbad-ending-quote = "double and single' missing-quotes.t100644000765000024 66114435630525 22717 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;bad-uni-esc.toml100644000765000024 1714435630525 22502 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringstr = "val\ue" rawstring-del.t100644000765000024 66114435630525 22664 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;string-del.toml100644000765000024 2514435630525 22634 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlstring-del = "null" comment-lf.toml100644000765000024 3214435630525 22623 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlcomment-lf = "ctrl-P" #  comment-us.toml100644000765000024 3214435630525 22651 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlcomment-us = "ctrl-_" #  rawmulti-null.t100644000765000024 66114435630525 22716 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;multi-null.toml100644000765000024 3114435630525 22663 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlmulti-null = """null""" mixed-string-table.t100644000765000024 324614435630525 22732 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/array# 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;mixed-int-float.toml100644000765000024 3314435630525 22673 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/arrayints-and-floats = [1, 1.1] mixed-int-array.toml100644000765000024 6514435630525 22711 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/arrayarrays-and-ints = [1, ["Arrays are not integers."]] string-quote-comma.t100644000765000024 264514435630525 22770 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/array# 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;milliseconds.toml100644000765000024 22014435630525 23053 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/datetimeutc1 = 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 end-in-bool.t100644000765000024 273314435630525 22563 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/inline-table# 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;with-single-quotes.t100644000765000024 604714435630525 22756 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table# 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;escaped-escape.toml100644000765000024 2114435630525 22721 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/stringanswer = "\\x64" unicode-escape.toml100644000765000024 5214435630525 22747 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/stringanswer4 = "\u03B4" answer8 = "\U000003B4" no-close-table-2.t100644000765000024 66314435630525 22505 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/array# 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;text-in-array.toml100644000765000024 7014435630525 22726 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/arrayarray = [ "Entry 1", I don't belong, "Entry 2", ] trailing-t.toml100644000765000024 2014435630525 22745 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/datetimed = 2006-01-30T without-value-2.toml100644000765000024 714435630525 22630 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/keykey = without-value-1.toml100644000765000024 414435630525 22624 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/keykey text-after-table.t100644000765000024 66314435630525 22663 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# 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;inf-incomplete-2.t100644000765000024 66314435630525 22601 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;nan-incomplete-3.t100644000765000024 66314435630525 22602 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;inf-incomplete-1.t100644000765000024 66314435630525 22600 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;leading-zero-neg.t100644000765000024 66314435630525 22660 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;exp-double-us.toml100644000765000024 2714435630525 22704 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatexp-double-us = 1e__23 leading-point.toml100644000765000024 2714435630525 22745 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatleading-point = .12345 nan-incomplete-1.t100644000765000024 66314435630525 22600 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;inf-incomplete-3.t100644000765000024 66314435630525 22602 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;nan-incomplete-2.t100644000765000024 66314435630525 22601 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;invalid-bin.toml100644000765000024 2514435630525 22735 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integerinvalid-bin = 0b0012 trailing-us.toml100644000765000024 2314435630525 22775 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integertrailing-us = 123_ leading-zero-1.t100644000765000024 66314435630525 22577 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;capital-oct.toml100644000765000024 2214435630525 22736 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integercapital-oct = 0O0 leading-zero-2.t100644000765000024 66314435630525 22600 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;invalid-hex.toml100644000765000024 2514435630525 22751 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integerinvalid-hex = 0xaafz leading-us-hex.t100644000765000024 66314435630525 22673 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;invalid-oct.toml100644000765000024 2414435630525 22751 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integerinvalid-oct = 0o778 capital-hex.toml100644000765000024 2214435630525 22735 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integercapital-hex = 0X1 capital-bin.toml100644000765000024 2214435630525 22721 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integercapital-bin = 0B0 leading-us-oct.t100644000765000024 66314435630525 22674 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;leading-us-bin.t100644000765000024 66314435630525 22657 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;bad-byte-escape.t100644000765000024 66314435630525 22657 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;comment-del.toml100644000765000024 3114435630525 22765 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlcomment-del = "0x7f" #  rawmulti-lf.toml100644000765000024 3214435630525 23025 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlrawmulti-lf = '''null''' rawmulti-us.toml100644000765000024 3214435630525 23053 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlrawmulti-us = '''null''' string-null.toml100644000765000024 2614435630525 23043 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlstring-null = "null" rawstring-null.t100644000765000024 66314435630525 23074 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/control# 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;spec-example-1-compact.toml100644000765000024 57014435630525 22747 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid#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" ] mixed-int-string.toml100644000765000024 3614435630525 23077 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/arraystrings-and-ints = ["hi", 42] nested-inline-table.t100644000765000024 262514435630525 23056 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/array# 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;multiline.toml100644000765000024 13014435630525 23137 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/inline-tabletbl_multiline = { a = 1, b = """ multiline """, c = """and yet another line""", d = 4 } inline-table.t100644000765000024 2334314435630525 23043 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/inline-table# 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;with-literal-string.t100644000765000024 617714435630525 23123 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table# 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;unicode-literal.toml100644000765000024 1614435630525 23143 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/stringanswer = "δ" missing-separator.t100644000765000024 66514435630525 23213 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/array# 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;no-close-table.toml100644000765000024 2014435630525 23021 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/arrayx = [{ key = 42 single-open-bracket.t100644000765000024 66514435630525 23047 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;array-implicit.toml100644000765000024 115614435630525 23167 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# 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" exp-leading-us.toml100644000765000024 2714435630525 23035 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatexp-leading-us = 1e_23 nan_underscore.toml100644000765000024 2614435630525 23217 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatnan_underscore = na_n exp-double-e-2.toml100644000765000024 2714435630525 22640 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatexp-double-e-2 = 1e2e3 double-point-1.toml100644000765000024 2614435630525 22751 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatdouble-point-1 = 0..1 inf_underscore.toml100644000765000024 2614435630525 23217 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatinf_underscore = in_f trailing-point.toml100644000765000024 2414435630525 23150 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floattrailing-point = 1. double-point-2.toml100644000765000024 2714435630525 22753 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatdouble-point-2 = 0.1.2 us-after-point.toml100644000765000024 2614435630525 23067 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatus-after-point = 1._2 exp-double-e-1.toml100644000765000024 2614435630525 22636 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatexp-double-e-1 = 1ee2 leading-point-neg.t100644000765000024 66514435630525 23034 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;leading-zero-plus.t100644000765000024 66514435630525 23074 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;wrong-case-true.toml100644000765000024 1114435630525 23054 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/boola = TRUE us-after-oct.toml100644000765000024 2414435630525 23051 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integerus-after-oct = 0o_1 negative-oct.toml100644000765000024 2514435630525 23126 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integernegative-oct = -0o99 trailing-us-hex.t100644000765000024 66514435630525 23103 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;double-sign-nex.t100644000765000024 66514435630525 23063 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;positive-bin.toml100644000765000024 3314435630525 23150 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integerpositive-bin = +0b11010110 trailing-us-bin.t100644000765000024 66514435630525 23067 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;trailing-us-oct.t100644000765000024 66514435630525 23104 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;positive-hex.toml100644000765000024 2514435630525 23165 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integerpositive-hex = +0xff positive-oct.toml100644000765000024 2514435630525 23166 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integerpositive-oct = +0o99 us-after-bin.toml100644000765000024 2414435630525 23034 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integerus-after-bin = 0b_1 negative-bin.toml100644000765000024 3314435630525 23110 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integernegative-bin = -0b11010110 negative-hex.toml100644000765000024 2514435630525 23125 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integernegative-hex = -0xff us-after-hex.toml100644000765000024 2414435630525 23050 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integerus-after-hex = 0x_1 bad-slash-escape.t100644000765000024 66514435630525 23030 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;bad-codepoint.toml100644000765000024 12114435630525 23137 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringinvalid-codepoint = "This string contains a non scalar unicode codepoint \uD801" bad-multiline.toml100644000765000024 4114435630525 23136 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringmulti = "first line second line" rawmulti-del.toml100644000765000024 3314435630525 23171 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlrawmulti-del = '''null''' comment-null.toml100644000765000024 3214435630525 23174 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlcomment-null = "null" # rawstring-lf.toml100644000765000024 2714435630525 23205 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlrawstring-lf = 'null' rawstring-us.toml100644000765000024 2714435630525 23233 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlrawstring-us = 'null' string-quote-comma-2.t100644000765000024 255514435630525 23127 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/array# 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;string-with-comma.toml100644000765000024 6414435630525 23247 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/arraytitle = [ "Client: XXXX, Job: XXXX", "Code: XXXX" ] key-dotted.toml100644000765000024 46414435630525 23220 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/inline-tableinline = {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} array-table-array.toml100644000765000024 15414435630525 23206 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table[[a]] [[a.b]] [a.b.c] d = "val0" [[a.b]] [a.b.c] d = "val1" multiline-quotes.toml100644000765000024 70014435630525 23423 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/string# 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''' double-quote-escape.t100644000765000024 246414435630525 23267 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/string# 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;impossible-date.t100644000765000024 66714435630525 23305 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/datetime# 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;linebreak-4.t100644000765000024 66714435630525 23070 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/inline-table# 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;linebreak-3.t100644000765000024 66714435630525 23067 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/inline-table# 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;linebreak-2.t100644000765000024 66714435630525 23066 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/inline-table# 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;linebreak-1.t100644000765000024 66714435630525 23065 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/inline-table# 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;no-comma.toml100644000765000024 2214435630525 23152 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/inline-tablet = {x = 3 y = 4} bad-utf8-at-end.t100644000765000024 66714435630525 22776 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/encoding# 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;special-character.toml100644000765000024 3514435630525 23247 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/keyμ = "greek small letter mu" quoted-no-close.toml100644000765000024 4214435630525 23210 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table["where will it end] name = value exp-trailing-us.toml100644000765000024 3114435630525 23236 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatexp-trailing-us = 1e_23_ trailing-point-min.t100644000765000024 66714435630525 23256 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;us-before-point.toml100644000765000024 2714435630525 23231 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatus-before-point = 1_.2 leading-point-plus.t100644000765000024 66714435630525 23250 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;wrong-case-false.toml100644000765000024 1214435630525 23170 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/boolb = FALSE double-sign-plus.t100644000765000024 66714435630525 23256 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;text-after-string.t100644000765000024 66714435630525 23325 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;missing-quotes.toml100644000765000024 1514435630525 23400 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringname = value rawstring-del.toml100644000765000024 3014435630525 23342 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlrawstring-del = 'null' rawmulti-null.toml100644000765000024 3414435630525 23400 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlrawmulti-null = '''null''' implicit-and-explicit-after.t100644000765000024 1053214435630525 23421 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid# 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;string-quote-comma.toml100644000765000024 7014435630525 23426 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/arraytitle = [ "Client: \"XXXX\", Job: XXXX", "Code: XXXX" ] mixed-string-table.toml100644000765000024 21314435630525 23411 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/arraycontributors = [ "Foo Bar ", { name = "Baz Qux", email = "bazqux@example.com", url = "https://example.com/bazqux" } ] end-in-bool.toml100644000765000024 10614435630525 23243 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/inline-tableblack = { python=">3.6", version=">=18.9b0", allow_prereleases=true } with-single-quotes.toml100644000765000024 4514435630525 23416 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table['a'] [a.'b'] [a.'b'.c] answer = 42 no-close-table-2.toml100644000765000024 2214435630525 23162 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/arrayx = [{ key = 42 # double-comma.t100644000765000024 67114435630525 23332 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/inline-table# 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;dotted-redefine-table.t100644000765000024 67114435630525 23342 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;text-after-table.toml100644000765000024 3714435630525 23346 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table[error] this shouldn't be here duplicate-key-table.t100644000765000024 67114435630525 23337 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# 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;inf-incomplete-2.toml100644000765000024 2714435630525 23263 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatinf-incomplete-2 = +in nan-incomplete-3.toml100644000765000024 2714435630525 23264 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatnan-incomplete-3 = -na nan-incomplete-2.toml100644000765000024 2714435630525 23263 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatnan-incomplete-2 = +na inf-incomplete-3.toml100644000765000024 2714435630525 23264 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatinf-incomplete-3 = -in trailing-point-plus.t100644000765000024 67114435630525 23451 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/float# 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;leading-zero-neg.toml100644000765000024 3214435630525 23336 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatleading-zero-neg = -03.14 nan-incomplete-1.toml100644000765000024 2614435630525 23261 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatnan-incomplete-1 = na inf-incomplete-1.toml100644000765000024 2614435630525 23261 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatinf-incomplete-1 = in leading-us-bin.toml100644000765000024 2614435630525 23340 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integerleading-us-bin = _0o1 leading-us-hex.toml100644000765000024 2614435630525 23354 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integerleading-us-hex = _0o1 leading-zero-2.toml100644000765000024 2414435630525 23257 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integerleading-zero-2 = 00 leading-zero-1.toml100644000765000024 2414435630525 23256 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integerleading-zero-1 = 01 leading-us-oct.toml100644000765000024 2614435630525 23355 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integerleading-us-oct = _0o1 multiline-quotes-1.t100644000765000024 67114435630525 23407 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;multiline-quotes-2.t100644000765000024 67114435630525 23410 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;bad-byte-escape.toml100644000765000024 2114435630525 23333 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringnaughty = "\xAg" basic-byte-escapes.t100644000765000024 67114435630525 23374 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;multiline-no-close.t100644000765000024 67114435630525 23450 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;rawstring-null.toml100644000765000024 3114435630525 23551 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/controlrawstring-null = 'null' implicit-and-explicit-before.t100644000765000024 1053614435630525 23566 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid# 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;nested-inline-table.toml100644000765000024 2314435630525 23514 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/arraya = [ { b = {} } ] inline-table.toml100644000765000024 23514435630525 23506 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/inline-tablename = { first = "Tom", last = "Preston-Werner" } point = { x = 1, y = 2 } simple = { a = 1 } str-key = { "a" = 1 } table-array = [{ "a" = 1 }, { "b" = 2 }] with-literal-string.toml100644000765000024 5114435630525 23554 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/table['a'] [a.'"b"'] [a.'"b"'.c] answer = 42 missing-separator.toml100644000765000024 2214435630525 23666 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/arraywrong = [ 1 2 3 ] bare-invalid-character.t100644000765000024 67314435630525 23504 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# 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;single-open-bracket.toml100644000765000024 214435630525 23500 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key[ empty-implicit-table.t100644000765000024 67314435630525 23547 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# 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;nested-brackets-open.t100644000765000024 67314435630525 23531 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# 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;leading-zero-plus.toml100644000765000024 3314435630525 23551 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatleading-zero-plus = +03.14 leading-point-neg.toml100644000765000024 3414435630525 23512 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatleading-point-neg = -.12345 trailing-us-oct.toml100644000765000024 2714435630525 23564 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integertrailing-us-oct = 0o1_ trailing-us-bin.toml100644000765000024 2714435630525 23547 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integertrailing-us-bin = 0b1_ trailing-us-hex.toml100644000765000024 2714435630525 23563 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integertrailing-us-hex = 0x1_ double-sign-nex.toml100644000765000024 2714435630525 23543 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integerdouble-sign-nex = --99 text-after-integer.t100644000765000024 67314435630525 23600 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;bad-slash-escape.toml100644000765000024 7614435630525 23514 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringinvalid-escape = "This string has a bad \/ escape character." string-quote-comma-2.toml100644000765000024 2414435630525 23564 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/arraytitle = [ " \", ",] double-quote-escape.toml100644000765000024 2114435630525 23722 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/stringtest = "\"one\"" impossible-date.toml100644000765000024 3114435630525 23756 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/datetimed = 2006-01-50T00:00:00Z linebreak-4.toml100644000765000024 11314435630525 23562 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/inline-tablejson_like = { first = "Tom", last = "Preston-Werner" } linebreak-3.toml100644000765000024 1714435630525 23544 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/inline-tablet = {a=1 ,b=2} linebreak-2.toml100644000765000024 1714435630525 23543 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/inline-tablet = {a=1, b=2} linebreak-1.toml100644000765000024 15714435630525 23567 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/inline-table# No newlines are allowed between the curly braces unless they are valid within # a value. simple = { a = 1 } trailing-comma.t100644000765000024 67514435630525 23675 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/inline-table# 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;bad-utf8-in-string.t100644000765000024 67514435630525 23537 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/encoding# 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;bom-not-at-start-1.t100644000765000024 67514435630525 23463 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/encoding# 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;bom-not-at-start-2.t100644000765000024 67514435630525 23464 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/encoding# 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;bad-utf8-at-end.toml100644000765000024 36214435630525 23476 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/encoding# 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 = """"""Únested-brackets-close.t100644000765000024 67514435630525 23677 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# 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;array-missing-bracket.t100644000765000024 67514435630525 23714 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# 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;duplicate-table-array.t100644000765000024 67514435630525 23671 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# 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;leading-point-plus.toml100644000765000024 3514435630525 23725 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floatleading-point-plus = +.12345 trailing-point-min.toml100644000765000024 3114435630525 23727 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floattrailing-point-min = -1. double-sign-plus.toml100644000765000024 3014435630525 23726 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integerdouble-sign-plus = ++99 leading-zero-sign-2.t100644000765000024 67514435630525 23541 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;leading-zero-sign-1.t100644000765000024 67514435630525 23540 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integer# 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;multiline-no-close-2.t100644000765000024 67514435630525 23613 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;text-after-string.toml100644000765000024 5414435630525 24003 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringstring = "Is there life after strings?" No. basic-unknown-escape.t100644000765000024 67514435630525 23751 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;implicit-and-explicit-after.toml100644000765000024 4514435630525 24047 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid[a.b.c] answer = 42 [a] better = 43 no-leads-with-milli.t100644000765000024 67714435630525 24004 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/datetime# 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;double-comma.toml100644000765000024 1714435630525 24014 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/inline-tablet = {x=3,,y=4} bad-utf8-in-comment.t100644000765000024 67714435630525 23675 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/encoding# 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;dotted-redefine-table.toml100644000765000024 11414435630525 24042 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/key# Defined a.b as int a.b = 1 # Tries to access it as table: error a.b.c = 2 duplicate-table-array2.t100644000765000024 67714435630525 23755 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table# 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;duplicate-key-table.toml100644000765000024 6314435630525 24022 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table[fruit] type = "apple" [fruit.type] apple = "yes" trailing-point-plus.toml100644000765000024 3214435630525 24130 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/floattrailing-point-plus = +1. multiline-quotes-1.toml100644000765000024 3014435630525 24064 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringa = """6 quotes: """""" multiline-no-close.toml100644000765000024 4114435630525 24127 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringinvalid = """ this will fail multiline-quotes-2.toml100644000765000024 3014435630525 24065 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringa = """6 quotes: """""" basic-byte-escapes.toml100644000765000024 2014435630525 24050 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringanswer = "\x33" implicit-and-explicit-before.toml100644000765000024 4514435630525 24210 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid[a] better = 43 [a.b.c] answer = 42 bare-invalid-character.toml100644000765000024 1714435630525 24164 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/keybare!key = 123 empty-implicit-table.toml100644000765000024 2314435630525 24224 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table[naughty..naughty] nested-brackets-open.toml100644000765000024 1714435630525 24211 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table[a[b] zyx = 42 text-after-integer.toml100644000765000024 4114435630525 24255 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integeranswer = 42 the ultimate answer? multiline-escape-space.t100644000765000024 70114435630525 24254 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;basic-multiline-quotes.t100644000765000024 70114435630525 24322 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;text-after-array-entries.t100644000765000024 70314435630525 24403 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/array# 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;trailing-comma.toml100644000765000024 21414435630525 24372 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/inline-table# A terminating comma (also called trailing comma) is not permitted after the # last key/value pair in an inline table abc = { abc = 123, } bom-not-at-start-2.toml100644000765000024 2514435630525 24141 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/encodingbom-not-at-start= ÿý bad-utf8-in-string.toml100644000765000024 10314435630525 24231 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/encoding# The following line contains an invalid UTF-8 sequence. bad = "Ã" bom-not-at-start-1.toml100644000765000024 2414435630525 24137 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/encodingbom-not-at-start ÿý nested-brackets-close.toml100644000765000024 1714435630525 24355 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table[a]b] zyx = 42 duplicate-table-array.toml100644000765000024 1614435630525 24346 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table[tbl] [[tbl]] array-missing-bracket.toml100644000765000024 3714435630525 24374 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table[[albums] name = "Born to Run" leading-zero-sign-1.toml100644000765000024 3214435630525 24213 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integerleading-zero-sign-1 = -01 leading-zero-sign-2.toml100644000765000024 3214435630525 24214 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/integerleading-zero-sign-2 = +01 basic-unknown-escape.toml100644000765000024 1114435630525 24421 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringa = "\@" multiline-no-close-2.toml100644000765000024 614435630525 24247 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringx=""" no-leads-with-milli.toml100644000765000024 4414435630525 24460 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/datetimewith-milli = 1987-07-5T17:45:00.12Z bad-utf8-in-comment.toml100644000765000024 414435630525 24325 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/encoding# à duplicate-table-array2.toml100644000765000024 1614435630525 24430 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/table[[tbl]] [tbl] table-array-string-backslash.t100644000765000024 272014435630525 24667 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/array# 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;multiline-escape-space.toml100644000765000024 3414435630525 24743 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringa = """ foo \ \n bar""" basic-multiline-quotes.toml100644000765000024 6214435630525 25012 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringstr5 = """Here are three quotation marks: """.""" text-after-array-entries.toml100644000765000024 10614435630525 25110 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/arrayarray = [ "Is there life after an array separator?", No "Entry" ] text-before-array-separator.t100644000765000024 71114435630525 25072 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/array# 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;literal-multiline-quotes-1.t100644000765000024 71114435630525 25034 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;literal-multiline-quotes-2.t100644000765000024 71114435630525 25035 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;table-array-string-backslash.toml100644000765000024 3714435630525 25336 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/valid/arrayfoo = [ { bar="\"{{baz}}\""} ] text-before-array-separator.toml100644000765000024 10714435630525 25601 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/arrayarray = [ "Is there life before an array separator?" No, "Entry" ] literal-multiline-quotes-2.toml100644000765000024 5214435630525 25523 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringa = '''15 apostrophes: '''''''''''''''''' literal-multiline-quotes-1.toml100644000765000024 3614435630525 25524 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringa = '''6 apostrophes: '''''' basic-multiline-unknown-escape.t100644000765000024 72114435630525 25741 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;basic-multiline-unknown-escape.toml100644000765000024 1514435630525 26425 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringa = """\@""" basic-out-of-range-unicode-escape-1.t100644000765000024 73314435630525 26332 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;basic-out-of-range-unicode-escape-2.t100644000765000024 73314435630525 26333 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;basic-out-of-range-unicode-escape-2.toml100644000765000024 2114435630525 27011 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringa = "\U00D80000" basic-out-of-range-unicode-escape-1.toml100644000765000024 2114435630525 27010 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringa = "\UFFFFFFFF" basic-multiline-out-of-range-unicode-escape-2.t100644000765000024 75714435630525 30341 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;basic-multiline-out-of-range-unicode-escape-1.t100644000765000024 75714435630525 30340 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/string# 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;basic-multiline-out-of-range-unicode-escape-1.toml100644000765000024 2514435630525 31014 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringa = """\UFFFFFFFF""" basic-multiline-out-of-range-unicode-escape-2.toml100644000765000024 2514435630525 31015 0ustar00olafstaff000000000000TOML-Tiny-0.16/t/toml-test/invalid/stringa = """\U00D80000"""