TOML-Tiny-0.22 000755 001750 001751 0 15210037321 12151 5 ustar 00olaf olaf 000000 000000 README 100644 001750 001751 566 15210037321 13101 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22 This archive contains the distribution TOML-Tiny,
version 0.22:
a minimal, pure perl TOML parser and serializer
This software is copyright (c) 2026 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.037.
Changes 100644 001750 001751 10717 15210037321 13553 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22 0.22 2026-06-03
- Fix tests when Types::Serialiser is absent (GH#46) (Olaf Alders, Claude)
0.21 2026-05-10
- removed TOML::Parser from required prerequisites (GH#44) (Karen Etheridge)
0.20 2025-03-25
- Fix parsing of quoted keys (GH#41) (Ian Jackson)
- Fix writing of more kinds of quote-needing keys (GH#40) (Ian Jackson)
- Avoid looking at string values to try to find the type (GH#37) (Ian Jackson)
- die if data to be encoded is not a hashref (GH#36) (djerius)
- inline table keys were not normalized via to_toml_key() (GH#35) (djerius)
0.19 2025-02-11
- trap and die on undefined values (GH#32) (djerius)
0.18 2024-09-04
- Support builtin booleans (GH#31) (Tina Mller (tinita))
0.17 2024-06-03
- regexp for values which match a DateTime should be anchored to start and end
of string (GH#30) (djerius)
0.16 2023-05-31
- Remove when (GH#25) (Olaf Alders)
- Test strict mode in to_toml_array() (GH#26) (Olaf Alders)
- Replace @Author::BLUEFEET with equivalent config (GH#23) (Olaf Alders)
- Make some imports explicit (GH#19) (Olaf Alders)
0.15 2021-08-13
- bugfix: strings with "inf" or "nan" in them no longer treated as special
floats
0.14 2021-08-02
- Fix an issue with serialisation of nan, inf, and -inf (thanks jjatria)
- Enforcement of homogenous arrays is no longer supported as it has been
dropped from the TOML spec
- strict_arrays is now strict (strict_arrays still accepted for compatibility)
- strict mode now disallows trailing commas
- bugfix: table names whose individual segments include a dot can no longer
cause parser to incorrectly identify duplicate table names
- bugfix: correctly fail on arrays without separators
- bugfix: correctly fail when array ends without closing at EOF
- bugfix: correctly fail when inline table is missing separators or has
trailing separator
- bugfix: disallow non-permitted control characters in strings and comments
- bugfix: disallow invalid unicode in input
- bugfix: allow double-zero exponents (e00)
- bugfix: correctly parse multi-line literal strings, dealing properly with
some edge cases
- bugfix: correctly parse multi-line basic strings, dealing properly with some
edge cases
- bugfix: correctly escape unicode control characters in toml output
- bugfix: correctly handle comment-like sequences in multiline strings
- bugfix: correctly handle keys with names that are toml keywords
- bugfix: better handling of inf/nan in parsing, writing
- bugfix: correctly generate empty inline tables within arrays
- bugfix: make duplicate key enforcement match the toml 1.0 spec
- bugfix: update datetime support to match toml abnf, w/ workaround for
burntsushi tests supporting lowercase z and toml supporting a space instead
of T
- bugfix: fix support for local dates, local times, fractional second precision
- bugfix: fix parsing of dotted keys in inline tables
- bugfix: fixes for escapes and unicode in key names, both in parsing and
generating toml
0.13 2021-07-26
-Fix a spurious warning being raised on trailing spaces in hexadecimal numbers (thanks jjatria)
0.12 2021-05-28
-Fix bug causing to_toml to incorrectly dereference \1 and \0 (thanks oschwald)
0.11 2021-02-12
-Fix bug in strict_arrays where string containing integer is recognized as an
integer, causing parsing to fail when present in an array containing other
strings
0.10 2020-09-08
-Remove dependency on DateTime::Format::RFC3339
0.09 2020-08-11
-Fix warning when calling `to_toml(from_toml(...))`
-Fix bug allowing perl to stringify numbers (thanks oschwald)
-Fix bug disallowing weird forms of nan (+nan, -nan)
-Behavior change: return Math::Big(Int|Float) for large numbers (thanks oschwald)
0.08 2020-06-25
-Fix bug in TOML table output generation (thanks ijackson)
0.07 2020-05-08
-Add support for floating time zones in TOML output (thanks ijackson)
-Fix bug where datetimes were being outputed as ISO8601 instead of RFC3339
-Clarified documentation with explicit description of supported perl types for each toml type
0.06 2020-03-30
-Performance improvements in TOML::Tiny::Tokenizer->next_token
-Fix totally broken OO interface (thanks noctux)
0.05 2020-01-21
-POD fixes for TOML::Tiny::Grammar
0.04 2020-01-21
-Remove superfluous dependency on DateTime::Format::RFC3339, which was only
needed for unit tests
0.03 2020-01-18
-Remove automatic inflation of numerical types using Math::Big(Int|Float);
this may now be done with inflate_integer and inflate_float
0.02 2020-01-17
-Add MANIFEST.SKIP to prevent dzil from including author scripts
0.01 2020-01-17
-Initial release
LICENSE 100644 001750 001751 46270 15210037321 13270 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22 This software is copyright (c) 2026 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) 2026 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.
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, see .
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
Moe Ghoul, President of Vice
That's all there is to it!
--- The Perl Artistic License 1.0 ---
This software is Copyright (c) 2026 by Jeff Ober.
This is free software, licensed under:
The Perl Artistic License 1.0
The "Artistic License"
Preamble
The intent of this document is to state the conditions under which a
Package may be copied, such that the Copyright Holder maintains some
semblance of artistic control over the development of the package,
while giving the users of the package the right to use and distribute
the Package in a more-or-less customary fashion, plus the right to make
reasonable modifications.
Definitions:
"Package" refers to the collection of files distributed by the
Copyright Holder, and derivatives of that collection of files
created through textual modification.
"Standard Version" refers to such a Package if it has not been
modified, or has been modified in accordance with the wishes
of the Copyright Holder as specified below.
"Copyright Holder" is whoever is named in the copyright or
copyrights for the package.
"You" is you, if you're thinking about copying or distributing
this Package.
"Reasonable copying fee" is whatever you can justify on the
basis of media cost, duplication charges, time of people involved,
and so on. (You will not be required to justify it to the
Copyright Holder, but only to the computing community at large
as a market that must bear the fee.)
"Freely Available" means that no fee is charged for the item
itself, though there may be fees involved in handling the item.
It also means that recipients of the item may redistribute it
under the same conditions they received it.
1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.
2. You may apply bug fixes, portability fixes and other modifications
derived from the Public Domain or from the Copyright Holder. A Package
modified in such a way shall still be considered the Standard Version.
3. You may otherwise modify your copy of this Package in any way, provided
that you insert a prominent notice in each changed file stating how and
when you changed that file, and provided that you do at least ONE of the
following:
a) place your modifications in the Public Domain or otherwise make them
Freely Available, such as by posting said modifications to Usenet or
an equivalent medium, or placing the modifications on a major archive
site such as uunet.uu.net, or by allowing the Copyright Holder to include
your modifications in the Standard Version of the Package.
b) use the modified Package only within your corporation or organization.
c) rename any non-standard executables so the names do not conflict
with standard executables, which must also be provided, and provide
a separate manual page for each non-standard executable that clearly
documents how it differs from the Standard Version.
d) make other distribution arrangements with the Copyright Holder.
4. You may distribute the programs of this Package in object code or
executable form, provided that you do at least ONE of the following:
a) distribute a Standard Version of the executables and library files,
together with instructions (in the manual page or equivalent) on where
to get the Standard Version.
b) accompany the distribution with the machine-readable source of
the Package with your modifications.
c) give non-standard executables non-standard names, and clearly
document the differences in manual pages (or equivalent), together
with instructions on where to get the Standard Version.
d) make other distribution arrangements with the Copyright Holder.
5. You may charge a reasonable copying fee for any distribution of this
Package. You may charge any fee you choose for support of this
Package. You may not charge a fee for this Package itself. However,
you may distribute this Package in aggregate with other (possibly
commercial) programs as part of a larger (possibly commercial) software
distribution provided that you do not advertise this Package as a
product of your own. You may embed this Package's interpreter within
an executable of yours (by linking); this shall be construed as a mere
form of aggregation, provided that the complete Standard Version of the
interpreter is so embedded.
6. The scripts and library files supplied as input to or produced as
output from the programs of this Package do not automatically fall
under the copyright of this Package, but belong to whoever generated
them, and may be sold commercially, and may be aggregated with this
Package. If such scripts or library files are aggregated with this
Package via the so-called "undump" or "unexec" methods of producing a
binary executable image, then distribution of such an image shall
neither be construed as a distribution of this Package nor shall it
fall under the restrictions of Paragraphs 3 and 4, provided that you do
not represent such an executable image as a Standard Version of this
Package.
7. C subroutines (or comparably compiled subroutines in other
languages) supplied by you and linked into this Package in order to
emulate subroutines and variables of the language defined by this
Package shall not be considered part of this Package, but are the
equivalent of input as in Paragraph 6, provided these subroutines do
not change the language in any way that would cause it to fail the
regression tests for the language.
8. Aggregation of this Package with a commercial distribution is always
permitted provided that the use of this Package is embedded; that is,
when no overt attempt is made to make this Package's interfaces visible
to the end user of the commercial distribution. Such use shall not be
construed as a distribution of this Package.
9. The name of the Copyright Holder may not be used to endorse or promote
products derived from this software without specific prior written permission.
10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
The End
dist.ini 100644 001750 001751 1010 15210037321 13666 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22 name = TOML-Tiny
author = Jeff Ober
license = Perl_5
copyright_holder = Jeff Ober
[@Basic]
[Git::Check]
allow_dirty = Changes
allow_dirty = README.pod
[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]
allow_dirty = Changes
allow_dirty = README.pod
[Git::Tag]
[Git::Push]
[PodWeaver]
cpanfile 100644 001750 001751 1153 15210037321 13736 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22 requires 'perl' => '>= 5.018';
requires 'Carp' => '0';
requires 'Data::Dumper' => '0';
requires 'Exporter' => '0';
requires 'Encode' => '0';
requires 'Math::BigInt' => '>= 1.999718';
requires 'DateTime::Format::RFC3339' => '0';
requires 'DateTime::Format::ISO8601' => '0';
recommends 'Types::Serialiser' => 0;
on test => sub{
requires 'Data::Dumper' => '0';
requires 'Test2::V0' => '0';
requires 'Test::Needs' => '0';
recommends 'Unicode::GCString' => '0';
};
on 'develop' => sub {
requires 'TOML::Parser' => '0';
};
META.yml 100644 001750 001751 2043 15210037321 13502 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22 ---
abstract: 'a minimal, pure perl TOML parser and serializer'
author:
- 'Jeff Ober '
build_requires:
Data::Dumper: '0'
ExtUtils::MakeMaker: '0'
File::Spec: '0'
Test2::V0: '0'
Test::More: '0'
Test::Needs: '0'
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'Dist::Zilla version 6.037, CPAN::Meta::Converter version 2.150013'
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'
DateTime::Format::ISO8601: '0'
DateTime::Format::RFC3339: '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.22'
x_generated_by_perl: v5.42.2
x_serialization_backend: 'YAML::Tiny version 1.76'
x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later'
MANIFEST 100644 001750 001751 60441 15210037321 13410 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.037
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/builtin-booleans.t
t/faithful-booleans.t
t/faithful.t
t/numbers.t
t/parity.t
t/parser.t
t/strict_arrays.t
t/toml-test/invalid/array/missing-separator.t
t/toml-test/invalid/array/missing-separator.toml
t/toml-test/invalid/array/no-close-2.t
t/toml-test/invalid/array/no-close-2.toml
t/toml-test/invalid/array/no-close-table-2.t
t/toml-test/invalid/array/no-close-table-2.toml
t/toml-test/invalid/array/no-close-table.t
t/toml-test/invalid/array/no-close-table.toml
t/toml-test/invalid/array/no-close.t
t/toml-test/invalid/array/no-close.toml
t/toml-test/invalid/array/tables-1.t
t/toml-test/invalid/array/tables-1.toml
t/toml-test/invalid/array/tables-2.t
t/toml-test/invalid/array/tables-2.toml
t/toml-test/invalid/array/text-after-array-entries.t
t/toml-test/invalid/array/text-after-array-entries.toml
t/toml-test/invalid/array/text-before-array-separator.t
t/toml-test/invalid/array/text-before-array-separator.toml
t/toml-test/invalid/array/text-in-array.t
t/toml-test/invalid/array/text-in-array.toml
t/toml-test/invalid/bool/mixed-case.t
t/toml-test/invalid/bool/mixed-case.toml
t/toml-test/invalid/bool/wrong-case-false.t
t/toml-test/invalid/bool/wrong-case-false.toml
t/toml-test/invalid/bool/wrong-case-true.t
t/toml-test/invalid/bool/wrong-case-true.toml
t/toml-test/invalid/control/comment-del.t
t/toml-test/invalid/control/comment-del.toml
t/toml-test/invalid/control/comment-lf.t
t/toml-test/invalid/control/comment-lf.toml
t/toml-test/invalid/control/comment-null.t
t/toml-test/invalid/control/comment-null.toml
t/toml-test/invalid/control/comment-us.t
t/toml-test/invalid/control/comment-us.toml
t/toml-test/invalid/control/multi-del.t
t/toml-test/invalid/control/multi-del.toml
t/toml-test/invalid/control/multi-lf.t
t/toml-test/invalid/control/multi-lf.toml
t/toml-test/invalid/control/multi-null.t
t/toml-test/invalid/control/multi-null.toml
t/toml-test/invalid/control/multi-us.t
t/toml-test/invalid/control/multi-us.toml
t/toml-test/invalid/control/rawmulti-del.t
t/toml-test/invalid/control/rawmulti-del.toml
t/toml-test/invalid/control/rawmulti-lf.t
t/toml-test/invalid/control/rawmulti-lf.toml
t/toml-test/invalid/control/rawmulti-null.t
t/toml-test/invalid/control/rawmulti-null.toml
t/toml-test/invalid/control/rawmulti-us.t
t/toml-test/invalid/control/rawmulti-us.toml
t/toml-test/invalid/control/rawstring-del.t
t/toml-test/invalid/control/rawstring-del.toml
t/toml-test/invalid/control/rawstring-lf.t
t/toml-test/invalid/control/rawstring-lf.toml
t/toml-test/invalid/control/rawstring-null.t
t/toml-test/invalid/control/rawstring-null.toml
t/toml-test/invalid/control/rawstring-us.t
t/toml-test/invalid/control/rawstring-us.toml
t/toml-test/invalid/control/string-bs.t
t/toml-test/invalid/control/string-bs.toml
t/toml-test/invalid/control/string-del.t
t/toml-test/invalid/control/string-del.toml
t/toml-test/invalid/control/string-lf.t
t/toml-test/invalid/control/string-lf.toml
t/toml-test/invalid/control/string-null.t
t/toml-test/invalid/control/string-null.toml
t/toml-test/invalid/control/string-us.t
t/toml-test/invalid/control/string-us.toml
t/toml-test/invalid/datetime/impossible-date.t
t/toml-test/invalid/datetime/impossible-date.toml
t/toml-test/invalid/datetime/no-leads-with-milli.t
t/toml-test/invalid/datetime/no-leads-with-milli.toml
t/toml-test/invalid/datetime/no-leads.t
t/toml-test/invalid/datetime/no-leads.toml
t/toml-test/invalid/datetime/no-secs.t
t/toml-test/invalid/datetime/no-secs.toml
t/toml-test/invalid/datetime/no-t.t
t/toml-test/invalid/datetime/no-t.toml
t/toml-test/invalid/datetime/trailing-t.t
t/toml-test/invalid/datetime/trailing-t.toml
t/toml-test/invalid/encoding/bad-utf8-at-end.t
t/toml-test/invalid/encoding/bad-utf8-at-end.toml
t/toml-test/invalid/encoding/bad-utf8-in-comment.t
t/toml-test/invalid/encoding/bad-utf8-in-comment.toml
t/toml-test/invalid/encoding/bad-utf8-in-string.t
t/toml-test/invalid/encoding/bad-utf8-in-string.toml
t/toml-test/invalid/encoding/bom-not-at-start-1.t
t/toml-test/invalid/encoding/bom-not-at-start-1.toml
t/toml-test/invalid/encoding/bom-not-at-start-2.t
t/toml-test/invalid/encoding/bom-not-at-start-2.toml
t/toml-test/invalid/encoding/utf16-bom.t
t/toml-test/invalid/encoding/utf16-bom.toml
t/toml-test/invalid/encoding/utf16.t
t/toml-test/invalid/encoding/utf16.toml
t/toml-test/invalid/float/double-point-1.t
t/toml-test/invalid/float/double-point-1.toml
t/toml-test/invalid/float/double-point-2.t
t/toml-test/invalid/float/double-point-2.toml
t/toml-test/invalid/float/exp-double-e-1.t
t/toml-test/invalid/float/exp-double-e-1.toml
t/toml-test/invalid/float/exp-double-e-2.t
t/toml-test/invalid/float/exp-double-e-2.toml
t/toml-test/invalid/float/exp-double-us.t
t/toml-test/invalid/float/exp-double-us.toml
t/toml-test/invalid/float/exp-leading-us.t
t/toml-test/invalid/float/exp-leading-us.toml
t/toml-test/invalid/float/exp-point-1.t
t/toml-test/invalid/float/exp-point-1.toml
t/toml-test/invalid/float/exp-point-2.t
t/toml-test/invalid/float/exp-point-2.toml
t/toml-test/invalid/float/exp-trailing-us.t
t/toml-test/invalid/float/exp-trailing-us.toml
t/toml-test/invalid/float/inf-incomplete-1.t
t/toml-test/invalid/float/inf-incomplete-1.toml
t/toml-test/invalid/float/inf-incomplete-2.t
t/toml-test/invalid/float/inf-incomplete-2.toml
t/toml-test/invalid/float/inf-incomplete-3.t
t/toml-test/invalid/float/inf-incomplete-3.toml
t/toml-test/invalid/float/inf_underscore.t
t/toml-test/invalid/float/inf_underscore.toml
t/toml-test/invalid/float/leading-point-neg.t
t/toml-test/invalid/float/leading-point-neg.toml
t/toml-test/invalid/float/leading-point-plus.t
t/toml-test/invalid/float/leading-point-plus.toml
t/toml-test/invalid/float/leading-point.t
t/toml-test/invalid/float/leading-point.toml
t/toml-test/invalid/float/leading-us.t
t/toml-test/invalid/float/leading-us.toml
t/toml-test/invalid/float/leading-zero-neg.t
t/toml-test/invalid/float/leading-zero-neg.toml
t/toml-test/invalid/float/leading-zero-plus.t
t/toml-test/invalid/float/leading-zero-plus.toml
t/toml-test/invalid/float/leading-zero.t
t/toml-test/invalid/float/leading-zero.toml
t/toml-test/invalid/float/nan-incomplete-1.t
t/toml-test/invalid/float/nan-incomplete-1.toml
t/toml-test/invalid/float/nan-incomplete-2.t
t/toml-test/invalid/float/nan-incomplete-2.toml
t/toml-test/invalid/float/nan-incomplete-3.t
t/toml-test/invalid/float/nan-incomplete-3.toml
t/toml-test/invalid/float/nan_underscore.t
t/toml-test/invalid/float/nan_underscore.toml
t/toml-test/invalid/float/trailing-point-min.t
t/toml-test/invalid/float/trailing-point-min.toml
t/toml-test/invalid/float/trailing-point-plus.t
t/toml-test/invalid/float/trailing-point-plus.toml
t/toml-test/invalid/float/trailing-point.t
t/toml-test/invalid/float/trailing-point.toml
t/toml-test/invalid/float/trailing-us.t
t/toml-test/invalid/float/trailing-us.toml
t/toml-test/invalid/float/us-after-point.t
t/toml-test/invalid/float/us-after-point.toml
t/toml-test/invalid/float/us-before-point.t
t/toml-test/invalid/float/us-before-point.toml
t/toml-test/invalid/inline-table/double-comma.t
t/toml-test/invalid/inline-table/double-comma.toml
t/toml-test/invalid/inline-table/empty.t
t/toml-test/invalid/inline-table/empty.toml
t/toml-test/invalid/inline-table/linebreak-1.t
t/toml-test/invalid/inline-table/linebreak-1.toml
t/toml-test/invalid/inline-table/linebreak-2.t
t/toml-test/invalid/inline-table/linebreak-2.toml
t/toml-test/invalid/inline-table/linebreak-3.t
t/toml-test/invalid/inline-table/linebreak-3.toml
t/toml-test/invalid/inline-table/linebreak-4.t
t/toml-test/invalid/inline-table/linebreak-4.toml
t/toml-test/invalid/inline-table/no-comma.t
t/toml-test/invalid/inline-table/no-comma.toml
t/toml-test/invalid/inline-table/trailing-comma.t
t/toml-test/invalid/inline-table/trailing-comma.toml
t/toml-test/invalid/integer/capital-bin.t
t/toml-test/invalid/integer/capital-bin.toml
t/toml-test/invalid/integer/capital-hex.t
t/toml-test/invalid/integer/capital-hex.toml
t/toml-test/invalid/integer/capital-oct.t
t/toml-test/invalid/integer/capital-oct.toml
t/toml-test/invalid/integer/double-sign-nex.t
t/toml-test/invalid/integer/double-sign-nex.toml
t/toml-test/invalid/integer/double-sign-plus.t
t/toml-test/invalid/integer/double-sign-plus.toml
t/toml-test/invalid/integer/double-us.t
t/toml-test/invalid/integer/double-us.toml
t/toml-test/invalid/integer/invalid-bin.t
t/toml-test/invalid/integer/invalid-bin.toml
t/toml-test/invalid/integer/invalid-hex.t
t/toml-test/invalid/integer/invalid-hex.toml
t/toml-test/invalid/integer/invalid-oct.t
t/toml-test/invalid/integer/invalid-oct.toml
t/toml-test/invalid/integer/leading-us-bin.t
t/toml-test/invalid/integer/leading-us-bin.toml
t/toml-test/invalid/integer/leading-us-hex.t
t/toml-test/invalid/integer/leading-us-hex.toml
t/toml-test/invalid/integer/leading-us-oct.t
t/toml-test/invalid/integer/leading-us-oct.toml
t/toml-test/invalid/integer/leading-us.t
t/toml-test/invalid/integer/leading-us.toml
t/toml-test/invalid/integer/leading-zero-1.t
t/toml-test/invalid/integer/leading-zero-1.toml
t/toml-test/invalid/integer/leading-zero-2.t
t/toml-test/invalid/integer/leading-zero-2.toml
t/toml-test/invalid/integer/leading-zero-sign-1.t
t/toml-test/invalid/integer/leading-zero-sign-1.toml
t/toml-test/invalid/integer/leading-zero-sign-2.t
t/toml-test/invalid/integer/leading-zero-sign-2.toml
t/toml-test/invalid/integer/negative-bin.t
t/toml-test/invalid/integer/negative-bin.toml
t/toml-test/invalid/integer/negative-hex.t
t/toml-test/invalid/integer/negative-hex.toml
t/toml-test/invalid/integer/negative-oct.t
t/toml-test/invalid/integer/negative-oct.toml
t/toml-test/invalid/integer/positive-bin.t
t/toml-test/invalid/integer/positive-bin.toml
t/toml-test/invalid/integer/positive-hex.t
t/toml-test/invalid/integer/positive-hex.toml
t/toml-test/invalid/integer/positive-oct.t
t/toml-test/invalid/integer/positive-oct.toml
t/toml-test/invalid/integer/text-after-integer.t
t/toml-test/invalid/integer/text-after-integer.toml
t/toml-test/invalid/integer/trailing-us-bin.t
t/toml-test/invalid/integer/trailing-us-bin.toml
t/toml-test/invalid/integer/trailing-us-hex.t
t/toml-test/invalid/integer/trailing-us-hex.toml
t/toml-test/invalid/integer/trailing-us-oct.t
t/toml-test/invalid/integer/trailing-us-oct.toml
t/toml-test/invalid/integer/trailing-us.t
t/toml-test/invalid/integer/trailing-us.toml
t/toml-test/invalid/integer/us-after-bin.t
t/toml-test/invalid/integer/us-after-bin.toml
t/toml-test/invalid/integer/us-after-hex.t
t/toml-test/invalid/integer/us-after-hex.toml
t/toml-test/invalid/integer/us-after-oct.t
t/toml-test/invalid/integer/us-after-oct.toml
t/toml-test/invalid/key/after-array.t
t/toml-test/invalid/key/after-array.toml
t/toml-test/invalid/key/after-table.t
t/toml-test/invalid/key/after-table.toml
t/toml-test/invalid/key/after-value.t
t/toml-test/invalid/key/after-value.toml
t/toml-test/invalid/key/bare-invalid-character.t
t/toml-test/invalid/key/bare-invalid-character.toml
t/toml-test/invalid/key/dotted-redefine-table.t
t/toml-test/invalid/key/dotted-redefine-table.toml
t/toml-test/invalid/key/duplicate-keys.t
t/toml-test/invalid/key/duplicate-keys.toml
t/toml-test/invalid/key/duplicate.t
t/toml-test/invalid/key/duplicate.toml
t/toml-test/invalid/key/empty.t
t/toml-test/invalid/key/empty.toml
t/toml-test/invalid/key/escape.t
t/toml-test/invalid/key/escape.toml
t/toml-test/invalid/key/hash.t
t/toml-test/invalid/key/hash.toml
t/toml-test/invalid/key/multiline.t
t/toml-test/invalid/key/multiline.toml
t/toml-test/invalid/key/newline.t
t/toml-test/invalid/key/newline.toml
t/toml-test/invalid/key/no-eol.t
t/toml-test/invalid/key/no-eol.toml
t/toml-test/invalid/key/open-bracket.t
t/toml-test/invalid/key/open-bracket.toml
t/toml-test/invalid/key/partial-quoted.t
t/toml-test/invalid/key/partial-quoted.toml
t/toml-test/invalid/key/single-open-bracket.t
t/toml-test/invalid/key/single-open-bracket.toml
t/toml-test/invalid/key/space.t
t/toml-test/invalid/key/space.toml
t/toml-test/invalid/key/special-character.t
t/toml-test/invalid/key/special-character.toml
t/toml-test/invalid/key/start-bracket.t
t/toml-test/invalid/key/start-bracket.toml
t/toml-test/invalid/key/two-equals.t
t/toml-test/invalid/key/two-equals.toml
t/toml-test/invalid/key/two-equals2.t
t/toml-test/invalid/key/two-equals2.toml
t/toml-test/invalid/key/two-equals3.t
t/toml-test/invalid/key/two-equals3.toml
t/toml-test/invalid/key/without-value-1.t
t/toml-test/invalid/key/without-value-1.toml
t/toml-test/invalid/key/without-value-2.t
t/toml-test/invalid/key/without-value-2.toml
t/toml-test/invalid/string/bad-byte-escape.t
t/toml-test/invalid/string/bad-byte-escape.toml
t/toml-test/invalid/string/bad-codepoint.t
t/toml-test/invalid/string/bad-codepoint.toml
t/toml-test/invalid/string/bad-concat.t
t/toml-test/invalid/string/bad-concat.toml
t/toml-test/invalid/string/bad-escape.t
t/toml-test/invalid/string/bad-escape.toml
t/toml-test/invalid/string/bad-multiline.t
t/toml-test/invalid/string/bad-multiline.toml
t/toml-test/invalid/string/bad-slash-escape.t
t/toml-test/invalid/string/bad-slash-escape.toml
t/toml-test/invalid/string/bad-uni-esc.t
t/toml-test/invalid/string/bad-uni-esc.toml
t/toml-test/invalid/string/basic-byte-escapes.t
t/toml-test/invalid/string/basic-byte-escapes.toml
t/toml-test/invalid/string/basic-multiline-out-of-range-unicode-escape-1.t
t/toml-test/invalid/string/basic-multiline-out-of-range-unicode-escape-1.toml
t/toml-test/invalid/string/basic-multiline-out-of-range-unicode-escape-2.t
t/toml-test/invalid/string/basic-multiline-out-of-range-unicode-escape-2.toml
t/toml-test/invalid/string/basic-multiline-quotes.t
t/toml-test/invalid/string/basic-multiline-quotes.toml
t/toml-test/invalid/string/basic-multiline-unknown-escape.t
t/toml-test/invalid/string/basic-multiline-unknown-escape.toml
t/toml-test/invalid/string/basic-out-of-range-unicode-escape-1.t
t/toml-test/invalid/string/basic-out-of-range-unicode-escape-1.toml
t/toml-test/invalid/string/basic-out-of-range-unicode-escape-2.t
t/toml-test/invalid/string/basic-out-of-range-unicode-escape-2.toml
t/toml-test/invalid/string/basic-unknown-escape.t
t/toml-test/invalid/string/basic-unknown-escape.toml
t/toml-test/invalid/string/literal-multiline-quotes-1.t
t/toml-test/invalid/string/literal-multiline-quotes-1.toml
t/toml-test/invalid/string/literal-multiline-quotes-2.t
t/toml-test/invalid/string/literal-multiline-quotes-2.toml
t/toml-test/invalid/string/missing-quotes.t
t/toml-test/invalid/string/missing-quotes.toml
t/toml-test/invalid/string/multiline-escape-space.t
t/toml-test/invalid/string/multiline-escape-space.toml
t/toml-test/invalid/string/multiline-no-close-2.t
t/toml-test/invalid/string/multiline-no-close-2.toml
t/toml-test/invalid/string/multiline-no-close.t
t/toml-test/invalid/string/multiline-no-close.toml
t/toml-test/invalid/string/multiline-quotes-1.t
t/toml-test/invalid/string/multiline-quotes-1.toml
t/toml-test/invalid/string/multiline-quotes-2.t
t/toml-test/invalid/string/multiline-quotes-2.toml
t/toml-test/invalid/string/no-close.t
t/toml-test/invalid/string/no-close.toml
t/toml-test/invalid/string/text-after-string.t
t/toml-test/invalid/string/text-after-string.toml
t/toml-test/invalid/string/wrong-close.t
t/toml-test/invalid/string/wrong-close.toml
t/toml-test/invalid/table/array-empty.t
t/toml-test/invalid/table/array-empty.toml
t/toml-test/invalid/table/array-implicit.t
t/toml-test/invalid/table/array-implicit.toml
t/toml-test/invalid/table/array-missing-bracket.t
t/toml-test/invalid/table/array-missing-bracket.toml
t/toml-test/invalid/table/duplicate-key-table.t
t/toml-test/invalid/table/duplicate-key-table.toml
t/toml-test/invalid/table/duplicate-table-array.t
t/toml-test/invalid/table/duplicate-table-array.toml
t/toml-test/invalid/table/duplicate-table-array2.t
t/toml-test/invalid/table/duplicate-table-array2.toml
t/toml-test/invalid/table/duplicate.t
t/toml-test/invalid/table/duplicate.toml
t/toml-test/invalid/table/empty-implicit-table.t
t/toml-test/invalid/table/empty-implicit-table.toml
t/toml-test/invalid/table/empty.t
t/toml-test/invalid/table/empty.toml
t/toml-test/invalid/table/equals-sign.t
t/toml-test/invalid/table/equals-sign.toml
t/toml-test/invalid/table/llbrace.t
t/toml-test/invalid/table/llbrace.toml
t/toml-test/invalid/table/nested-brackets-close.t
t/toml-test/invalid/table/nested-brackets-close.toml
t/toml-test/invalid/table/nested-brackets-open.t
t/toml-test/invalid/table/nested-brackets-open.toml
t/toml-test/invalid/table/quoted-no-close.t
t/toml-test/invalid/table/quoted-no-close.toml
t/toml-test/invalid/table/redefine.t
t/toml-test/invalid/table/redefine.toml
t/toml-test/invalid/table/rrbrace.t
t/toml-test/invalid/table/rrbrace.toml
t/toml-test/invalid/table/text-after-table.t
t/toml-test/invalid/table/text-after-table.toml
t/toml-test/invalid/table/whitespace.t
t/toml-test/invalid/table/whitespace.toml
t/toml-test/invalid/table/with-pound.t
t/toml-test/invalid/table/with-pound.toml
t/toml-test/valid/array/array.t
t/toml-test/valid/array/array.toml
t/toml-test/valid/array/bool.t
t/toml-test/valid/array/bool.toml
t/toml-test/valid/array/empty.t
t/toml-test/valid/array/empty.toml
t/toml-test/valid/array/hetergeneous.t
t/toml-test/valid/array/hetergeneous.toml
t/toml-test/valid/array/mixed-int-array.t
t/toml-test/valid/array/mixed-int-array.toml
t/toml-test/valid/array/mixed-int-float.t
t/toml-test/valid/array/mixed-int-float.toml
t/toml-test/valid/array/mixed-int-string.t
t/toml-test/valid/array/mixed-int-string.toml
t/toml-test/valid/array/mixed-string-table.t
t/toml-test/valid/array/mixed-string-table.toml
t/toml-test/valid/array/nested-double.t
t/toml-test/valid/array/nested-double.toml
t/toml-test/valid/array/nested-inline-table.t
t/toml-test/valid/array/nested-inline-table.toml
t/toml-test/valid/array/nested.t
t/toml-test/valid/array/nested.toml
t/toml-test/valid/array/nospaces.t
t/toml-test/valid/array/nospaces.toml
t/toml-test/valid/array/string-quote-comma-2.t
t/toml-test/valid/array/string-quote-comma-2.toml
t/toml-test/valid/array/string-quote-comma.t
t/toml-test/valid/array/string-quote-comma.toml
t/toml-test/valid/array/string-with-comma.t
t/toml-test/valid/array/string-with-comma.toml
t/toml-test/valid/array/strings.t
t/toml-test/valid/array/strings.toml
t/toml-test/valid/array/table-array-string-backslash.t
t/toml-test/valid/array/table-array-string-backslash.toml
t/toml-test/valid/bool/bool.t
t/toml-test/valid/bool/bool.toml
t/toml-test/valid/comment/at-eof.t
t/toml-test/valid/comment/at-eof.toml
t/toml-test/valid/comment/at-eof2.t
t/toml-test/valid/comment/at-eof2.toml
t/toml-test/valid/comment/everywhere.t
t/toml-test/valid/comment/everywhere.toml
t/toml-test/valid/comment/tricky.t
t/toml-test/valid/comment/tricky.toml
t/toml-test/valid/datetime/datetime.t
t/toml-test/valid/datetime/datetime.toml
t/toml-test/valid/datetime/local-date.t
t/toml-test/valid/datetime/local-date.toml
t/toml-test/valid/datetime/local-time.t
t/toml-test/valid/datetime/local-time.toml
t/toml-test/valid/datetime/local.t
t/toml-test/valid/datetime/local.toml
t/toml-test/valid/datetime/milliseconds.t
t/toml-test/valid/datetime/milliseconds.toml
t/toml-test/valid/datetime/timezone.t
t/toml-test/valid/datetime/timezone.toml
t/toml-test/valid/empty-file.t
t/toml-test/valid/empty-file.toml
t/toml-test/valid/example.t
t/toml-test/valid/example.toml
t/toml-test/valid/float/exponent.t
t/toml-test/valid/float/exponent.toml
t/toml-test/valid/float/float.t
t/toml-test/valid/float/float.toml
t/toml-test/valid/float/inf-and-nan.t
t/toml-test/valid/float/inf-and-nan.toml
t/toml-test/valid/float/long.t
t/toml-test/valid/float/long.toml
t/toml-test/valid/float/underscore.t
t/toml-test/valid/float/underscore.toml
t/toml-test/valid/float/zero.t
t/toml-test/valid/float/zero.toml
t/toml-test/valid/implicit-and-explicit-after.t
t/toml-test/valid/implicit-and-explicit-after.toml
t/toml-test/valid/implicit-and-explicit-before.t
t/toml-test/valid/implicit-and-explicit-before.toml
t/toml-test/valid/implicit-groups.t
t/toml-test/valid/implicit-groups.toml
t/toml-test/valid/inline-table/array.t
t/toml-test/valid/inline-table/array.toml
t/toml-test/valid/inline-table/bool.t
t/toml-test/valid/inline-table/bool.toml
t/toml-test/valid/inline-table/empty.t
t/toml-test/valid/inline-table/empty.toml
t/toml-test/valid/inline-table/end-in-bool.t
t/toml-test/valid/inline-table/end-in-bool.toml
t/toml-test/valid/inline-table/inline-table.t
t/toml-test/valid/inline-table/inline-table.toml
t/toml-test/valid/inline-table/key-dotted.t
t/toml-test/valid/inline-table/key-dotted.toml
t/toml-test/valid/inline-table/multiline.t
t/toml-test/valid/inline-table/multiline.toml
t/toml-test/valid/inline-table/nest.t
t/toml-test/valid/inline-table/nest.toml
t/toml-test/valid/integer/integer.t
t/toml-test/valid/integer/integer.toml
t/toml-test/valid/integer/literals.t
t/toml-test/valid/integer/literals.toml
t/toml-test/valid/integer/long.t
t/toml-test/valid/integer/long.toml
t/toml-test/valid/integer/underscore.t
t/toml-test/valid/integer/underscore.toml
t/toml-test/valid/integer/zero.t
t/toml-test/valid/integer/zero.toml
t/toml-test/valid/key/alphanum.t
t/toml-test/valid/key/alphanum.toml
t/toml-test/valid/key/case-sensitive.t
t/toml-test/valid/key/case-sensitive.toml
t/toml-test/valid/key/dotted.t
t/toml-test/valid/key/dotted.toml
t/toml-test/valid/key/empty.t
t/toml-test/valid/key/empty.toml
t/toml-test/valid/key/equals-nospace.t
t/toml-test/valid/key/equals-nospace.toml
t/toml-test/valid/key/escapes.t
t/toml-test/valid/key/escapes.toml
t/toml-test/valid/key/numeric-dotted.t
t/toml-test/valid/key/numeric-dotted.toml
t/toml-test/valid/key/numeric.t
t/toml-test/valid/key/numeric.toml
t/toml-test/valid/key/quoted-dots.t
t/toml-test/valid/key/quoted-dots.toml
t/toml-test/valid/key/space.t
t/toml-test/valid/key/space.toml
t/toml-test/valid/key/special-chars.t
t/toml-test/valid/key/special-chars.toml
t/toml-test/valid/key/special-word.t
t/toml-test/valid/key/special-word.toml
t/toml-test/valid/newline-crlf.t
t/toml-test/valid/newline-crlf.toml
t/toml-test/valid/newline-lf.t
t/toml-test/valid/newline-lf.toml
t/toml-test/valid/spec-example-1-compact.t
t/toml-test/valid/spec-example-1-compact.toml
t/toml-test/valid/spec-example-1.t
t/toml-test/valid/spec-example-1.toml
t/toml-test/valid/string/double-quote-escape.t
t/toml-test/valid/string/double-quote-escape.toml
t/toml-test/valid/string/empty.t
t/toml-test/valid/string/empty.toml
t/toml-test/valid/string/escape-tricky.t
t/toml-test/valid/string/escape-tricky.toml
t/toml-test/valid/string/escaped-escape.t
t/toml-test/valid/string/escaped-escape.toml
t/toml-test/valid/string/escapes.t
t/toml-test/valid/string/escapes.toml
t/toml-test/valid/string/multiline-quotes.t
t/toml-test/valid/string/multiline-quotes.toml
t/toml-test/valid/string/nl.t
t/toml-test/valid/string/nl.toml
t/toml-test/valid/string/raw-multiline.t
t/toml-test/valid/string/raw-multiline.toml
t/toml-test/valid/string/raw.t
t/toml-test/valid/string/raw.toml
t/toml-test/valid/string/simple.t
t/toml-test/valid/string/simple.toml
t/toml-test/valid/string/unicode-escape.t
t/toml-test/valid/string/unicode-escape.toml
t/toml-test/valid/string/unicode-literal.t
t/toml-test/valid/string/unicode-literal.toml
t/toml-test/valid/string/with-pound.t
t/toml-test/valid/string/with-pound.toml
t/toml-test/valid/table/array-implicit.t
t/toml-test/valid/table/array-implicit.toml
t/toml-test/valid/table/array-many.t
t/toml-test/valid/table/array-many.toml
t/toml-test/valid/table/array-nest.t
t/toml-test/valid/table/array-nest.toml
t/toml-test/valid/table/array-one.t
t/toml-test/valid/table/array-one.toml
t/toml-test/valid/table/array-table-array.t
t/toml-test/valid/table/array-table-array.toml
t/toml-test/valid/table/empty.t
t/toml-test/valid/table/empty.toml
t/toml-test/valid/table/keyword.t
t/toml-test/valid/table/keyword.toml
t/toml-test/valid/table/names.t
t/toml-test/valid/table/names.toml
t/toml-test/valid/table/no-eol.t
t/toml-test/valid/table/no-eol.toml
t/toml-test/valid/table/sub-empty.t
t/toml-test/valid/table/sub-empty.toml
t/toml-test/valid/table/whitespace.t
t/toml-test/valid/table/whitespace.toml
t/toml-test/valid/table/with-literal-string.t
t/toml-test/valid/table/with-literal-string.toml
t/toml-test/valid/table/with-pound.t
t/toml-test/valid/table/with-pound.toml
t/toml-test/valid/table/with-single-quotes.t
t/toml-test/valid/table/with-single-quotes.toml
t/toml-test/valid/table/without-super.t
t/toml-test/valid/table/without-super.toml
t/writer.t
META.json 100644 001750 001751 4006 15210037321 13653 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22 {
"abstract" : "a minimal, pure perl TOML parser and serializer",
"author" : [
"Jeff Ober "
],
"dynamic_config" : 0,
"generated_by" : "Dist::Zilla version 6.037, CPAN::Meta::Converter version 2.150013",
"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" : {
"TOML::Parser" : "0",
"Test::Pod" : "1.41"
}
},
"runtime" : {
"recommends" : {
"Types::Serialiser" : "0"
},
"requires" : {
"Carp" : "0",
"Data::Dumper" : "0",
"DateTime::Format::ISO8601" : "0",
"DateTime::Format::RFC3339" : "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",
"ExtUtils::MakeMaker" : "0",
"File::Spec" : "0",
"Test2::V0" : "0",
"Test::More" : "0",
"Test::Needs" : "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.22",
"x_generated_by_perl" : "v5.42.2",
"x_serialization_backend" : "Cpanel::JSON::XS version 4.40",
"x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later"
}
Dockerfile 100644 001750 001751 304 15210037321 14201 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22 FROM 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
t 000755 001750 001751 0 15210037321 12335 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22 parser.t 100644 001750 001751 3640 15210037321 14161 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t use strict;
use warnings;
use Data::Dumper;
use Test2::V0;
use TOML::Tiny;
local $Data::Dumper::Sortkeys = 1;
local $Data::Dumper::Useqq = 1;
subtest 'oddballs and regressions' => sub{
subtest 'strings that look like numbers' => sub{
my $parser = TOML::Tiny->new(
inflate_integer => sub{
use Math::BigInt;
Math::BigInt->new(shift);
},
inflate_float => sub{
use Math::BigFloat;
Math::BigFloat->new(shift);
}
);
my $data = $parser->decode(q{
not_an_int = "42"
is_an_int = 42
not_a_flt = "4.2"
is_a_flt = 4.2
});
ok !ref($data->{not_an_int}), 'strings do not inflate as integers';
ok ref($data->{is_an_int}) && $data->{is_an_int}->isa('Math::BigInt'), 'integers do inflate with inflate_integer';
ok !ref($data->{not_a_flt}), 'strings do not inflate as floats';
ok ref($data->{is_a_flt}) && $data->{is_a_flt}->isa('Math::BigFloat'), 'floats do inflate with inflate_float';
};
subtest 'no dequoting of raw string keys' => sub {
my $funky_string = "a \\\\ \\x42 b \\\"";
my $toml = <(); diag $error; };
my $diag = sub {
};
ok $data->{key}{$funky_string} eq 'a', "key.funky" and
ok $data->{itable}{$funky_string} eq 'b', "not in inline table" and
ok $data->{table}{$funky_string}{x} eq 'c', "not in table heading" and
ok $data->{array}{$funky_string}[0]{y} eq 'd', "not in array item heading" or do {
$diag1->();
diag '';
diag 'PARSED AS';
diag Dumper($data);
}
};
};
done_testing;
parity.t 100644 001750 001751 4553 15210037321 14201 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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;
BEGIN {
eval { require TOML::Parser; };
plan skip_all => 'TOML::Parser required for parity testing'
if $@ and not $ENV{AUTHOR_TESTING} and not -d '.git';
}
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"
writer.t 100644 001750 001751 10635 15210037321 14223 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t use strict;
use warnings;
use DateTime ();
use Test2::V0;
use TOML::Tiny qw(from_toml to_toml);
use TOML::Tiny::Writer ();
my $src = do{ local $/; };
subtest basics => sub{
my $data = from_toml($src);
my $toml = to_toml($data);
my $got = from_toml($toml);
is $got, $data, 'to_toml <=> from_toml';
};
#-------------------------------------------------------------------------------
# Adapted from DateTime::Format::RFC3339.
#-------------------------------------------------------------------------------
subtest 'rfc3339 datetimes' => sub{
my $dt;
$dt = DateTime->new(year => 2002, month => 7, day => 1, hour => 13, minute => 50, second => 5, time_zone => 'UTC');
is TOML::Tiny::Writer::strftime_rfc3339($dt), '2002-07-01T13:50:05Z', 'UTC';
$dt = DateTime->new(year => 2002, month => 7, day => 1, hour => 13, minute => 50, second => 5, time_zone => 'Europe/London');
is TOML::Tiny::Writer::strftime_rfc3339($dt), '2002-07-01T13:50:05+01:00', 'positive offset';
$dt = DateTime->new(year => 2002, month => 1, day => 1, hour => 13, minute => 50, second => 5, time_zone => 'Europe/London');
is TOML::Tiny::Writer::strftime_rfc3339($dt), '2002-01-01T13:50:05+00:00', 'zero offset';
$dt = DateTime->new(year => 2002, month => 1, day => 1, hour => 13, minute => 50, second => 5, time_zone => 'America/New_York');
is TOML::Tiny::Writer::strftime_rfc3339($dt), '2002-01-01T13:50:05-05:00', 'negative offset';
$dt = DateTime->new(year => 1880, month => 1, day => 1, hour => 0, minute => 0, second => 0, time_zone => 'America/New_York');
is TOML::Tiny::Writer::strftime_rfc3339($dt), '1880-01-01T04:56:02Z', 'offset with non-integral minutes';
$dt = DateTime->new(year => 2002, month => 1, day => 1, hour => 13, minute => 50, second => 5, time_zone => 'floating');
is TOML::Tiny::Writer::strftime_rfc3339($dt), '2002-01-01T13:50:05', 'floating time zone';
};
subtest 'oddballs and regressions' => sub{
subtest 'strings that look like numbers' => sub{
my $data = {
is_inf => 'inf',
not_inf => 'to infinity and beyond',
is_nan => 'nan',
not_nan => 'no nan here',
};
is to_toml({a => 'no inf here'}), 'a="no inf here"', '"inf" present in string is string';
is to_toml({a => 'no nan here'}), 'a="no nan here"', '"nan" present in string is string';
};
subtest 'strings that contain DateTime but are not DateTime' => sub {
my $data = {
not_a_dt => 'Not a 2024-05-31T17:08:44',
};
is to_toml( $data ), 'not_a_dt="Not a 2024-05-31T17:08:44"',
$data->{not_a_dt};
};
subtest 'values which are undefined' => sub {
my $data = { deep => { in => { an => [ undef ] } } };
eval { to_toml( $data ) };
like $@, qr/found undefined value/;
};
subtest 'quoted inline table keys' => sub {
my $data = { q{foo} => [ q{bar}, { q{<=} => 33 } ] } ;
my $encoded = to_toml( $data );
my $decoded;
ok( lives { $decoded = from_toml( $encoded ) },
'decode succeeded' ) or note $@;
is ( $decoded, $data, 'round trip successful' );
};
subtest 'encoding a non-hashref' => sub {
eval { to_toml( q{} ) };
like $@, qr/must be a hashref/, 'scalar';
eval { to_toml( [] ) };
like $@, qr/must be a hashref/, 'array';
};
};
subtest 'to_toml_array' => sub{
my @to_toml = [1,2,3];
my $toml = TOML::Tiny::Writer::to_toml_array(\@to_toml, {strict => 1});
ok($toml, 'no exception in strict mode');
};
done_testing;
__DATA__
# This is a TOML document.
title = "TOML Example"
hetero_array = ["life", "universe", "everything", 42]
[owner]
name = "Tom Preston-Werner"
dob = 1979-05-27T07:32:00-08:00 # First class dates
[database]
server = "192.168.1.1"
ports = [ 8001, 8001, 8002 ]
connection_max = 5000
enabled = true
options = {"quote-keys"=false}
[servers]
# Indentation (tabs and/or spaces) is allowed but not required
[servers.alpha]
ip = "10.0.0.1"
dc = "eqdc10"
[servers.beta]
ip = "10.0.0.2"
dc = "eqdc10"
[clients]
data = [ ["gamma", "delta"], [1, 2] ]
# Line breaks are OK when inside arrays
hosts = [
"alpha",
"omega"
]
[cfg."something with a 'single-quote'".nested]
inner = "forty-one"
[cfg.'something with a "double-quote"'.nested]
inner = "forty-two"
[cfg."something with a 'single-quote' and a \"double-quote\"".nested]
inner = "forty-three"
[[products]]
name = "Hammer"
sku = 738594937
[[products]]
[[products]]
name = "Nail"
sku = 284758393
color = "gray"
numbers.t 100644 001750 001751 10117 15210037321 14355 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t use 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.PL 100644 001750 001751 4304 15210037321 14205 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.037
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,
"DateTime::Format::ISO8601" => 0,
"DateTime::Format::RFC3339" => 0,
"Encode" => 0,
"Exporter" => 0,
"Math::BigInt" => "1.999718"
},
"TEST_REQUIRES" => {
"Data::Dumper" => 0,
"ExtUtils::MakeMaker" => 0,
"File::Spec" => 0,
"Test2::V0" => 0,
"Test::More" => 0,
"Test::Needs" => 0
},
"VERSION" => "0.22",
"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",
"Test2::V0" => 0,
"Test::More" => 0,
"Test::Needs" => 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);
faithful.t 100644 001750 001751 2271 15210037321 14466 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t use utf8;
use Test2::V0;
use Data::Dumper;
use DateTime::Format::ISO8601;
use TOML::Tiny;
binmode STDIN, ':encoding(UTF-8)';
binmode STDOUT, ':encoding(UTF-8)';
my $input = q{
datetime=2020-05-04T16:37:02.905408062+01:00
datetimes="2020-05-04T16:37:02.905408062+01:00"
float=3.14
floats="3.14"
uint=3
uints="3"
nint=-4
nints="-4"
bigint=1852528528562625752750
bigints="1852528528562625752750"
hex=0x12
oct=0o751
bin=0b11010110
boolfs="false"
boolts="true"
dtlocal=1979-05-27T00:32:00.643144312
dtlocals="1979-05-27T00:32:00.643144312"
};
sub norm ($) {
join "\n", (
sort
map {
s{=0o(\d+)$}{ '='.oct($1) }e;
s{=(0[xb]\w+)$}{ '='.eval($1) }e;
$_;
}
grep /./,
split /\n/, $_[0]
), ''
}
my $coder = TOML::Tiny->new(
no_string_guessing => 1,
inflate_datetime => sub {
# RFC3339 bombs out if there is no timezone, so we parse with 8601
DateTime::Format::ISO8601->parse_datetime(shift)
},
);
my $parsed = $coder->decode($input);
my $actual = norm($coder->encode($parsed));
my $expected = norm($input);
is($actual, $expected, 'round trip') or do{
diag 'EXPECTED:';
diag Dumper($expected);
diag 'ACTUAL:';
diag Dumper($actual);
};
done_testing;
MANIFEST.SKIP 100644 001750 001751 32 15210037321 14063 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22 scratch.pl
build-tests.pl
perlimports.toml 100644 001750 001751 2112 15210037321 15503 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22 # Valid log levels are:
# debug, info, notice, warning, error, critical, alert, emergency
# critical, alert and emergency are not currently used.
#
# Please use boolean values in this config file. Negated options (--no-*) are
# not permitted here. Explicitly set options to true or false.
#
# Some of these values deviate from the regular perlimports defaults. In
# particular, you're encouraged to leave preserve_duplicates and
# preserve_unused disabled.
cache = false # setting this to true is currently discouraged
ignore_modules = ["Test2::V0"]
ignore_modules_filename = ""
ignore_modules_pattern = "" # regex like "^(Foo|Foo::Bar)"
ignore_modules_pattern_filename = ""
libs = ["lib", "t/lib"]
log_filename = ""
log_level = "warn"
never_export_modules = []
never_export_modules_filename = ""
padding = false
preserve_duplicates = false
preserve_unused = false
tidy_whitespace = true
TOML 000755 001750 001751 0 15210037321 13413 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/lib Tiny.pm 100644 001750 001751 25152 15210037321 15061 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/lib/TOML package TOML::Tiny;
# ABSTRACT: a minimal, pure perl TOML parser and serializer
$TOML::Tiny::VERSION = '0.22';
use strict;
use warnings;
no warnings qw(experimental);
use v5.18;
use TOML::Tiny::Parser ();
use TOML::Tiny::Writer ();
use parent 'Exporter';
our @EXPORT = qw(
from_toml
to_toml
);
#-------------------------------------------------------------------------------
# TOML module compatibility
#-------------------------------------------------------------------------------
sub from_toml {
my ($source, %param) = @_;
# strict was previously strict_arrays; accept both for backward
# compatibility.
if (exists $param{strict_arrays}) {
$param{strict} = $param{strict_arrays};
delete $param{strict_arrays};
}
my $parser = TOML::Tiny::Parser->new(%param);
my $toml = eval{ $parser->parse($source) };
if (wantarray) {
return ($toml, $@);
} else {
die $@ if $@;
return $toml;
}
}
sub to_toml {
my ($data, %param) = @_;
# strict was previously strict_arrays; accept both for backward
# compatibility.
if (exists $param{strict_arrays}) {
$param{strict} = $param{strict_arrays};
delete $param{strict_arrays};
}
TOML::Tiny::Writer::to_toml($data, %param);
}
#-------------------------------------------------------------------------------
# Object API
#-------------------------------------------------------------------------------
sub new {
my ($class, %param) = @_;
bless{ %param, parser => TOML::Tiny::Parser->new(%param) }, $class;
}
sub decode {
my ($self, $source) = @_;
$self->{parser}->parse($source);
}
sub encode {
my ($self, $data) = @_;
TOML::Tiny::Writer::to_toml(
$data,
strict => $self->{strict},
no_string_guessing => $self->{no_string_guessing},
);
}
#-------------------------------------------------------------------------------
# For compatibility with TOML::from_toml's use of $TOML::Parser
#-------------------------------------------------------------------------------
sub parse {
goto \&decode;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
TOML::Tiny - a minimal, pure perl TOML parser and serializer
=head1 VERSION
version 0.22
=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
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) 2026 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.t 100644 001750 001751 444 15210037321 15535 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t use 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;
builtin-booleans.t 100644 001750 001751 1337 15210037321 16134 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t use utf8;
use Test2::V0;
use Test::Needs 'Types::Serialiser';
use TOML::Tiny;
plan skip_all => 'No builtin::is_bool' unless defined &builtin::is_bool;
# Real Perl booleans should serialize identically to the booleans
# produced by round-tripping TOML through Types::Serialiser. Without
# Types::Serialiser the round-trip yields 1/0, so this lives in its own
# Test::Needs-guarded file. See GH #46.
my $regenerated = to_toml(scalar from_toml("f = false\nt = true\n"));
# Both sides contain only the "t"/"f" keys; to_toml sorts keys, so the
# two serializations are directly comparable.
my $data = { t => !!1, f => !!0 };
is(to_toml($data), $regenerated, 'builtin booleans serialize like Types::Serialiser booleans');
done_testing;
faithful-booleans.t 100644 001750 001751 1200 15210037321 16255 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t use utf8;
use Test2::V0;
use Test::Needs 'Types::Serialiser';
use TOML::Tiny;
# With Types::Serialiser installed, TOML booleans inflate to boolean
# objects and round-trip faithfully back to "true"/"false". Without it,
# they inflate to 1/0 and cannot round-trip (documented behaviour), so
# this coverage lives in its own Test::Needs-guarded file. See GH #46.
my $coder = TOML::Tiny->new(no_string_guessing => 1);
my $input = "boolf=false\nboolt=true\n";
my $output = join "\n", sort grep /./, split /\n/, $coder->encode($coder->decode($input));
is($output, "boolf=false\nboolt=true", 'booleans round-trip faithfully');
done_testing;
Tiny 000755 001750 001751 0 15210037321 14336 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/lib/TOML Util.pm 100644 001750 001751 3023 15210037321 15747 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/lib/TOML/Tiny package TOML::Tiny::Util;
# ABSTRACT: utility functions used by TOML::Tiny
$TOML::Tiny::Util::VERSION = '0.22';
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.22
=head1 AUTHOR
Jeff Ober
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2026 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.t 100644 001750 001751 453 15210037321 16252 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 13601 15210037321 16112 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.dd 100644 001750 001751 3550 15210037321 16220 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t do { my $x = {
'configure' => {
'requires' => {
'ExtUtils::MakeMaker' => '0'
}
},
'develop' => {
'requires' => {
'TOML::Parser' => '0',
'Test::Pod' => '1.41'
}
},
'runtime' => {
'recommends' => {
'Types::Serialiser' => '0'
},
'requires' => {
'Carp' => '0',
'Data::Dumper' => '0',
'DateTime::Format::ISO8601' => '0',
'DateTime::Format::RFC3339' => '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',
'ExtUtils::MakeMaker' => '0',
'File::Spec' => '0',
'Test2::V0' => '0',
'Test::More' => '0',
'Test::Needs' => '0'
}
}
};
$x;
} Writer.pm 100644 001750 001751 16345 15210037321 16341 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/lib/TOML/Tiny package TOML::Tiny::Writer;
$TOML::Tiny::Writer::VERSION = '0.22';
use strict;
use warnings;
no warnings qw(experimental);
use v5.18;
use B qw(SVf_IOK SVf_NOK svref_2object);
use Data::Dumper qw(Dumper);
use TOML::Tiny::Grammar qw($BareKey $DateTime $SpecialFloat);
use TOML::Tiny::Util qw(is_strict_array);
use constant CORE_BOOL => defined &builtin::is_bool;
my @KEYS;
sub to_toml {
my $data = shift;
die 'toml: data to encode must be a hashref' if ref $data ne 'HASH';
return _to_toml( $data, { @_ } );
}
sub _to_toml ($$);
sub _to_toml ($$) {
my $data = shift;
my $param = shift;
die 'toml: found undefined value, which is unsupported by TOML' if ! defined $data;
my $ref = ref $data;
if ($ref eq 'HASH') {
return to_toml_table($data, $param);
}
if ($ref eq 'ARRAY') {
return to_toml_array($data, $param);
}
if ($ref eq 'SCALAR') {
if ($$data eq '1') {
return 'true';
} elsif ($$data eq '0') {
return 'false';
} else {
return _to_toml($$_, $param);
}
}
if ($ref eq 'JSON::PP::Boolean') {
return $$data ? 'true' : 'false';
}
if ($ref eq 'Types::Serializer::Boolean') {
return $data ? 'true' : 'false';
}
if ($ref eq 'DateTime') {
return strftime_rfc3339($data);
}
if ($ref eq 'Math::BigInt') {
return $data->bstr;
}
if ($ref eq 'Math::BigFloat') {
if ($data->is_inf || $data->is_nan) {
return lc $data->bstr;
} else {
return $data->bstr;
}
}
if ($ref eq '') {
if (CORE_BOOL && builtin::is_bool($data)) {
return $data ? 'true' : 'false';
}
# Thanks to ikegami on Stack Overflow for the trick!
# https://stackoverflow.com/questions/12686335/how-to-tell-apart-numeric-scalars-and-string-scalars-in-perl/12693984#12693984
# note: this must come before any regex can flip this flag off
if (svref_2object(\$data)->FLAGS & (SVf_IOK | SVf_NOK)) {
return 'inf' if Math::BigFloat->new($data)->is_inf;
return '-inf' if Math::BigFloat->new($data)->is_inf('-');
return 'nan' if Math::BigFloat->new($data)->is_nan;
return $data;
}
return to_toml_string($data) if $param->{no_string_guessing};
#return $data if svref_2object(\$data)->FLAGS & (SVf_IOK | SVf_NOK);
return $data if $data =~ /^$DateTime$/;
return lc($data) if $data =~ /^$SpecialFloat$/;
return to_toml_string($data);
}
die 'unhandled: '.Dumper($ref);
}
sub to_toml_inline_table {
my ($data, $param) = @_;
my @buff;
for my $k (keys %$data) {
my $key = to_toml_key($k);
my $val = $data->{$k};
if (ref $val eq 'HASH') {
push @buff, $key . '=' . to_toml_inline_table($val);
} else {
push @buff, $key . '=' . _to_toml($val, $param);
}
}
return '{' . join(', ', @buff) . '}';
}
sub to_toml_table {
my ($data, $param) = @_;
my @buff_assign;
my @buff_tables;
# Generate simple key/value pairs for scalar data
for my $k (grep{ ref($data->{$_}) !~ /HASH|ARRAY/ } sort keys %$data) {
my $key = to_toml_key($k);
my $val = _to_toml($data->{$k}, $param);
push @buff_assign, "$key=$val";
}
# For arrays, generate an array of tables if all elements of the array are
# hashes. For mixed arrays, generate an inline array.
ARRAY: for my $k (grep{ ref $data->{$_} eq 'ARRAY' } sort keys %$data) {
# Empty table
if (!@{$data->{$k}}) {
my $key = to_toml_key($k);
push @buff_assign, "$key=[]";
next ARRAY;
}
# Mixed array
if (grep{ ref $_ ne 'HASH' } @{$data->{$k}}) {
my $key = to_toml_key($k);
my $val = _to_toml($data->{$k}, $param);
push @buff_assign, "$key=$val";
}
# Array of tables
else {
push @KEYS, $k;
for (@{ $data->{$k} }) {
push @buff_tables, '', '[[' . join('.', map{ to_toml_key($_) } @KEYS) . ']]';
push @buff_tables, _to_toml($_, $param);
}
pop @KEYS;
}
}
# Sub-tables
for my $k (grep{ ref $data->{$_} eq 'HASH' } sort keys %$data) {
if (!keys(%{$data->{$k}})) {
# Empty table
my $key = to_toml_key($k);
push @buff_assign, "$key={}";
} else {
# Generate [table]
push @KEYS, $k;
push @buff_tables, '', '[' . join('.', map{ to_toml_key($_) } @KEYS) . ']';
push @buff_tables, _to_toml($data->{$k}, $param);
pop @KEYS;
}
}
join "\n", @buff_assign, @buff_tables;
}
sub to_toml_array {
my ($data, $param) = @_;
if (@$data && $param->{strict}) {
my ($ok, $err) = is_strict_array($data);
die "toml: found heterogenous array, but strict is set ($err)\n" unless $ok;
}
my @items;
for my $item (@$data) {
if (ref $item eq 'HASH') {
push @items, to_toml_inline_table($item, $param);
} else {
push @items, _to_toml($item, $param);
}
}
return "[\n" . join("\n", map{ " $_," } @items) . "\n]";
}
sub to_toml_key {
my $str = shift;
if ($str =~ /^$BareKey$/) {
return $str;
} else {
# Not valid as a "bare key". Encode it as a "quoted key"
# (in TOML terminology), using the "literal string" format.
return to_toml_string($str);
}
}
sub to_toml_string {
state $escape = {
"\n" => '\n',
"\r" => '\r',
"\t" => '\t',
"\f" => '\f',
"\b" => '\b',
"\"" => '\"',
"\\" => '\\\\',
"\'" => '\\\'',
};
my ($arg) = @_;
$arg =~ s/(["\\\b\f\n\r\t])/$escape->{$1}/g;
$arg =~ s/([\p{General_Category=Control}])/'\\u00' . unpack('H2', $1)/eg;
return '"' . $arg . '"';
}
#-------------------------------------------------------------------------------
# Adapted from DateTime::Format::RFC3339.
#-------------------------------------------------------------------------------
sub strftime_rfc3339 {
my ($dt) = @_;
my $tz;
#-----------------------------------------------------------------------------
# Calculate the time zone offset for non-UTC time zones.
#
# TOML uses RFC3339 for datetimes, but supports a "local datetime" which
# excludes the timezone offset. A DateTime with a floating time zone
# indicates a TOML local datetime.
#
# DateTime::Format::RFC3339 requires a time zone, however, and defaults to
# +00:00 for floating time zones. To support local datetimes in output,
# format the datetime as RFC3339 and strip the timezone when encountering a
# floating time zone.
#-----------------------------------------------------------------------------
if ($dt->time_zone_short_name eq 'floating') {
$tz = '';
} elsif ($dt->time_zone->is_utc) {
$tz = 'Z';
} else {
my $sign = $dt->offset < 0 ? '-' : '+';
my $secs = abs $dt->offset;
my $mins = int($secs / 60);
$secs %= 60;
my $hours = int($mins / 60);
$mins %= 60;
if ($secs) {
$dt = $dt->clone;
$dt->set_time_zone('UTC');
$tz = 'Z';
} else {
$tz = sprintf '%s%02d:%02d', $sign, $hours, $mins;
}
}
my $format = $dt->nanosecond ? '%Y-%m-%dT%H:%M:%S.%9N' : '%Y-%m-%dT%H:%M:%S';
return $dt->strftime($format) . $tz;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
TOML::Tiny::Writer
=head1 VERSION
version 0.22
=head1 AUTHOR
Jeff Ober
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2026 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.pm 100644 001750 001751 31162 15210037321 16313 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/lib/TOML/Tiny package TOML::Tiny::Parser;
# ABSTRACT: parser used by TOML::Tiny
$TOML::Tiny::Parser::VERSION = '0.22';
use utf8;
use strict;
use warnings;
no warnings qw(experimental);
use v5.18;
use Carp qw(confess);
use Data::Dumper qw(Dumper);
use Encode qw(decode FB_CROAK);
use Math::BigFloat ();
use Math::BigInt ();
use TOML::Tiny::Grammar qw($TimeOffset);
use TOML::Tiny::Tokenizer ();
our $TRUE = 1;
our $FALSE = 0;
eval{
require Types::Serialiser;
$TRUE = Types::Serialiser::true();
$FALSE = Types::Serialiser::false();
};
sub new {
my ($class, %param) = @_;
bless{
inflate_integer => $param{inflate_integer},
inflate_float => $param{inflate_float},
inflate_datetime => $param{inflate_datetime} || sub{ shift },
inflate_boolean => $param{inflate_boolean} || sub{ shift eq 'true' ? $TRUE : $FALSE },
strict => $param{strict},
}, $class;
}
sub next_token {
my $self = shift;
my $token = $self->{tokenizer} && $self->{tokenizer}->next_token;
return $token;
}
sub parse {
my ($self, $toml) = @_;
if ($self->{strict}) {
$toml = decode('UTF-8', "$toml", FB_CROAK);
}
$self->{tokenizer} = TOML::Tiny::Tokenizer->new(source => $toml);
$self->{keys} = [];
$self->{root} = {};
$self->{tables} = {}; # "seen" hash of explicitly defined table names (e.g. [foo])
$self->{arrays} = {}; # "seen" hash of explicitly defined static arrays (e.g. foo=[])
$self->{array_tables} = {}; # "seen" hash of explicitly defined arrays of tables (e.g. [[foo]])
$self->parse_table;
my $result = $self->{root};
delete $self->{tokenizer};
delete $self->{keys};
delete $self->{root};
delete $self->{tables};
delete $self->{arrays};
delete $self->{array_tables};
return $result;
}
sub parse_error {
my ($self, $token, $msg) = @_;
my $line = $token ? $token->{line} : 'EOF';
if ($ENV{TOML_TINY_DEBUG}) {
my $root = Dumper($self->{root});
my $tok = Dumper($token);
my $src = substr $self->{tokenizer}{source}, $self->{tokenizer}{position}, 30;
confess qq{
toml parse error at line $line:
$msg
Current token:
$tok
Parse state:
$root
Source near location of error:
...
$src
...
};
} else {
die "toml parse error at line $line: $msg\n";
}
}
sub expect_type {
my ($self, $token, $expected) = @_;
my $actual = $token ? $token->{type} : 'EOF';
$self->parse_error($token, "expected $expected, but found $actual")
unless $actual =~ /$expected/;
}
sub current_key {
my $self = shift;
my @keys = $self->get_keys;
my $key = join '.', map{ qq{"$_"} } @keys;
return $key;
}
sub push_keys {
my ($self, $token) = @_;
push @{ $self->{keys} }, $token->{value};
}
sub pop_keys {
my $self = shift;
pop @{ $self->{keys} };
}
sub get_keys {
my $self = shift;
return map{ @$_ } @{ $self->{keys} };
}
sub set_key {
my ($self, $token) = @_;
my @keys = $self->get_keys;
my $key = pop @keys;
my $node = $self->scan_to_key(\@keys);
if ($key && exists $node->{$key}) {
$self->parse_error($token, 'duplicate key: ' . $self->current_key);
}
$node->{$key} = $self->parse_value($token);
}
sub declare_key {
my ($self, $token) = @_;
my $key = $self->current_key || return;
if ($token->{type} eq 'inline_array') {
$self->parse_error($token, "duplicate key: $key")
if exists $self->{array_tables}{$key};
$self->{arrays}{$key} = 1;
return;
}
if ($token->{type} eq 'array_table') {
if (exists $self->{arrays}{$key}) {
$self->parse_error($token, "duplicate key: $key");
}
$self->{array_tables}{$key} = 1;
return;
}
if ($token->{type} eq 'table') {
$self->parse_error($token, "duplicate key: $key")
if exists $self->{arrays}{$key}
|| exists $self->{array_tables}{$key};
if (exists $self->{tables}{$key}) {
# Tables cannot be redefined, *except* when doing so within a goddamn
# table array. Gawd I hate TOML.
my $in_a_stupid_table_array = 0;
my $node = $self->{root};
for my $key ($self->get_keys) {
if (exists $node->{$key} && ref($node->{$key}) eq 'ARRAY') {
$in_a_stupid_table_array = 1;
last;
} else {
$node = $node->{$key};
}
}
unless ($in_a_stupid_table_array) {
$self->parse_error($token, "duplicate key: $key");
}
return;
}
$self->{tables}{$key} = 1;
}
}
sub scan_to_key {
my $self = shift;
my $keys = shift // [ $self->get_keys ];
my $node = $self->{root};
KEY:
for my $key (@$keys) {
if (exists $node->{$key}) {
my $ref = ref $node->{$key};
if ( $ref eq 'HASH' ) {
$node = $node->{$key};
next KEY;
}
if ( $ref eq 'ARRAY' ) {
$node = $node->{$key}[-1];
next KEY;
}
my $full_key = join '.', @$keys;
die "$full_key is already defined\n";
}
else {
$node = $node->{$key} = {};
}
}
return $node;
}
sub parse_table {
my $self = shift;
my $token = shift // $self->next_token // return; # may be undef on first token in empty document
$self->expect_type($token, 'table');
$self->push_keys($token);
$self->scan_to_key;
$self->declare_key($token);
TOKEN: while (my $token = $self->next_token) {
my $type = $token->{type};
next TOKEN if $type eq 'EOL';
if ( $type eq 'key') {
$self->expect_type($self->next_token, 'assign');
$self->push_keys($token);
$self->set_key($self->next_token);
$self->pop_keys;
if (my $eol = $self->next_token) {
$self->expect_type($eol, 'EOL');
} else {
return;
}
next TOKEN;
}
if ($type eq 'array_table') {
$self->pop_keys;
@_ = ($self, $token);
goto \&parse_array_table;
}
if ( $type eq 'table') {
$self->pop_keys;
@_ = ($self, $token);
goto \&parse_table;
}
$self->parse_error($token, "expected key-value pair, table, or array of tables but got $type");
}
}
sub parse_array_table {
my $self = shift;
my $token = shift // $self->next_token;
$self->expect_type($token, 'array_table');
$self->push_keys($token);
$self->declare_key($token);
my @keys = $self->get_keys;
my $key = pop @keys;
my $node = $self->scan_to_key(\@keys);
$node->{$key} //= [];
push @{ $node->{$key} }, {};
TOKEN:
while (my $token = $self->next_token) {
my $type = $token->{type};
next TOKEN if $type eq 'EOL';
if ($type eq 'key') {
$self->expect_type($self->next_token, 'assign');
$self->push_keys($token);
$self->set_key($self->next_token);
$self->pop_keys;
next TOKEN;
}
if ($type eq 'array_table') {
$self->pop_keys;
@_ = ($self, $token);
goto \&parse_array_table;
}
if ($type eq 'table') {
$self->pop_keys;
@_ = ($self, $token);
goto \&parse_table;
}
$self->parse_error($token, "expected key-value pair, table, or array of tables but got $type");
}
}
sub parse_key {
my $self = shift;
my $token = shift // $self->next_token;
$self->expect_type($token, 'key');
return $token->{value};
}
sub parse_value {
my $self = shift;
my $token = shift;
my $type = $token->{type};
return $token->{value} if $type eq 'string';
return $self->inflate_float($token) if $type eq'float';
return $self->inflate_integer($token) if $type eq 'integer';
return $self->{inflate_boolean}->($token->{value}) if $type eq 'bool';
return $self->parse_datetime($token) if $type eq 'datetime';
return $self->parse_inline_table($token) if $type eq 'inline_table';
return $self->parse_array($token) if $type eq 'inline_array';
$self->parse_error($token, "value expected (bool, number, string, datetime, inline array, inline table), but found $type");
}
#-------------------------------------------------------------------------------
# TOML permits a space instead of a T, which RFC3339 does not allow. TOML (at
# least, according to BurntSushi/toml-tests) allows z instead of Z, which
# RFC3339 also does not permit. We will be flexible and allow them both, but
# fix them up. TOML also specifies millisecond precision. If fractional seconds
# are specified. Whatever.
#-------------------------------------------------------------------------------
sub parse_datetime {
my $self = shift;
my $token = shift;
my $value = $token->{value};
# Normalize
$value =~ tr/z/Z/;
$value =~ tr/ /T/;
$value =~ s/t/T/;
$value =~ s/(\.\d+)($TimeOffset)$/sprintf(".%09d%s", $1 * 1000000000, $2)/e;
return $self->{inflate_datetime}->($value);
}
sub parse_array {
my $self = shift;
my $token = shift;
$self->declare_key($token);
my @array;
my $expect = 'EOL|inline_array_close|string|float|integer|bool|datetime|inline_table|inline_array';
TOKEN: while (1) {
my $token = $self->next_token;
$self->expect_type($token, $expect);
if ( $token->{type} eq 'comma') {
$expect = 'EOL|inline_array_close|string|float|integer|bool|datetime|inline_table|inline_array';
next TOKEN;
}
next TOKEN if $token->{type} eq 'EOL';
last TOKEN if $token->{type} eq 'inline_array_close';
push @array, $self->parse_value($token);
$expect = 'comma|EOL|inline_array_close';
}
return \@array;
}
sub parse_inline_table {
my $self = shift;
my $token = shift;
my $table = {};
my $expect = 'EOL|inline_table_close|key';
TOKEN: while (1) {
my $token = $self->next_token;
$self->expect_type($token, $expect);
my $type = $token->{type};
if ($type eq 'comma') {
$expect = $self->{strict}
? 'EOL|key'
: 'EOL|key|inline_table_close';
next TOKEN;
}
if ($type eq 'key') {
$self->expect_type($self->next_token, 'assign');
my $node = $table;
my @keys = @{ $token->{value} };
my $key = pop @keys;
for (@keys) {
$node->{$_} ||= {};
$node = $node->{$_};
}
if (exists $node->{$key}) {
$self->parse_error($token, 'duplicate key: ' . join('.', map{ qq{"$_"} } @{ $token->{value} }));
} else {
$node->{ $key } = $self->parse_value($self->next_token);
}
$expect = 'comma|inline_table_close';
next TOKEN;
}
last TOKEN if $type eq 'inline_table_close';
$self->parse_error($token, "inline table expected key-value pair, but found $type");
}
return $table;
}
sub inflate_float {
my $self = shift;
my $token = shift;
my $value = $token->{value};
# Caller-defined inflation routine
if ($self->{inflate_float}) {
return $self->{inflate_float}->($value);
}
return 'NaN' if $value =~ /^[-+]?nan$/i;
return 'inf' if $value =~ /^\+?inf$/i;
return '-inf' if $value =~ /^-inf$/i;
# Not a bignum
if (0 + $value eq $value) {
return 0 + $value;
}
#-----------------------------------------------------------------------------
# Scientific notation is a hairier situation. In order to determine whether a
# value will fit inside a perl svnv, we can't just coerce the value to a
# number and then test it against the string, because, for example, this will
# always be false:
#
# 9 eq "3e2"
#
# Instead, we are forced to test the coerced value against a BigFloat, which
# is capable of holding the number.
#-----------------------------------------------------------------------------
if ($value =~ /[eE]/) {
if (Math::BigFloat->new($value)->beq(0 + $value)) {
return 0 + $value;
}
}
return Math::BigFloat->new($value);
}
sub inflate_integer {
my $self = shift;
my $token = shift;
my $value = $token->{value};
# Caller-defined inflation routine
if ($self->{inflate_integer}) {
return $self->{inflate_integer}->($value);
}
# Hex
if ($value =~ /^0x/) {
no warnings 'portable';
my $hex = hex $value;
my $big = Math::BigInt->new($value);
return $big->beq($hex) ? $hex : $big;
}
# Octal
if ($value =~ /^0o/) {
no warnings 'portable';
$value =~ s/^0o/0/;
my $oct = oct $value;
my $big = Math::BigInt->from_oct($value);
return $big->beq($oct) ? $oct : $big;
}
# Binary
if ($value =~ /^0b/) {
no warnings 'portable';
my $bin = oct $value; # oct handles 0b as binary
my $big = Math::BigInt->new($value);
return $big->beq($bin) ? $bin : $big;
}
# Not a bignum
if (0 + $value eq $value) {
return 0 + $value;
}
return Math::BigInt->new($value);
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
TOML::Tiny::Parser - parser used by TOML::Tiny
=head1 VERSION
version 0.22
=head1 AUTHOR
Jeff Ober
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2026 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.pm 100644 001750 001751 16753 15210037321 16456 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/lib/TOML/Tiny package TOML::Tiny::Grammar;
# ABSTRACT: exports regex definitions used to parse TOML source
$TOML::Tiny::Grammar::VERSION = '0.22';
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.22
=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) 2026 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.pm 100644 001750 001751 14077 15210037321 17037 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/lib/TOML/Tiny package TOML::Tiny::Tokenizer;
# ABSTRACT: tokenizer used by TOML::Tiny
$TOML::Tiny::Tokenizer::VERSION = '0.22';
use strict;
use warnings;
no warnings qw(experimental);
use charnames qw(:full);
use v5.18;
use TOML::Tiny::Grammar qw(
$Comment
$CRLF
$DateTime
$EOL
$Escape
$Float
$Integer
$Key
$SimpleKey
$String
$WS
);
sub new {
my ($class, %param) = @_;
my $self = bless{
source => $param{source},
last_position => length $param{source},
position => 0,
line => 1,
last_token => undef,
}, $class;
return $self;
}
sub last_token {
my $self = shift;
return $self->{last_token};
}
sub next_token {
my $self = shift;
return unless defined $self->{source}
&& $self->{position} < $self->{last_position};
if (!$self->{last_token}) {
return $self->{last_token} = {type => 'table', pos => 0, line => 1, value => []};
}
# Update the regex engine's position marker in case some other regex
# attempted to match against the source string and reset it.
pos($self->{source}) = $self->{position};
my $token;
my $type;
my $value;
state $key_set = qr/\G ($Key) $WS* (?= =)/x;
state $table = qr/\G \[ $WS* ($Key) $WS* \] $WS* (?:$EOL | $)/x;
state $array_table = qr/\G \[\[ $WS* ($Key) $WS* \]\] $WS* (?:$EOL | $)/x;
state $simple = {
'[' => 'inline_array',
']' => 'inline_array_close',
'{' => 'inline_table',
'}' => 'inline_table_close',
',' => 'comma',
'=' => 'assign',
'true' => 'bool',
'false' => 'bool',
};
# More complex matches with regexps
while ($self->{position} < $self->{last_position} && !defined($type)) {
my $prev = $self->{last_token} ? $self->{last_token}{type} : 'EOL';
my $newline = !!($prev eq 'EOL' || $prev eq 'table' || $prev eq 'array_table');
for ($self->{source}) {
/\G$WS+/gc; # ignore whitespace
/\G$Comment$/mgc && next; # ignore comments
last if /\G$/gc;
if (/\G$EOL/gc) {
++$self->{line};
$type = 'EOL';
last;
}
if ($newline) {
if (/$table/gc) {
$type = 'table';
$value = $self->tokenize_key($1);
last;
}
if (/$array_table/gc) {
$type = 'array_table';
$value = $self->tokenize_key($1);
last;
}
}
if (/$key_set/gc) {
$type = 'key';
$value = $1;
last;
}
if (/\G ( [\[\]{}=,] | true | false )/xgc) {
$value = $1;
$type = $simple->{$value};
last;
}
if (/\G($String)/gc) {
$type = 'string';
$value = $1;
last;
}
if (/\G($DateTime)/gc) {
$type = 'datetime';
$value = $1;
last;
}
if (/\G($Float)/gc) {
$type = 'float';
$value = $1;
last;
}
if (/\G($Integer)/gc) {
$type = 'integer';
$value = $1;
last;
}
my $substr = substr($self->{source}, $self->{position}, 30) // 'undef';
die "toml syntax error on line $self->{line}\n\t-->|$substr|\n";
}
if ($type) {
state $tokenizers = {};
my $tokenize = $tokenizers->{$type} //= $self->can("tokenize_$type") || 0;
$token = {
line => $self->{line},
pos => $self->{pos},
type => $type,
value => $tokenize ? $tokenize->($self, $value) : $value,
prev => $self->{last_token},
};
# Unset the previous token's 'prev' key to prevent keeping the entire
# chain of previously parsed tokens alive for the whole process.
undef $self->{last_token}{prev};
$self->{last_token} = $token;
}
$self->update_position;
}
return $token;
}
sub current_line {
my $self = shift;
my $rest = substr $self->{source}, $self->{position};
my $stop = index $rest, "\n";
substr $rest, 0, $stop;
}
sub update_position {
my $self = shift;
$self->{position} = pos($self->{source}) // 0;
}
sub error {
my $self = shift;
my $token = shift;
my $msg = shift // 'unknown';
my $line = $token ? $token->{line} : $self->{line};
die "toml: parse error at line $line: $msg\n";
}
sub tokenize_key {
my $self = shift;
my $toml = shift;
my @segs = $toml =~ /($SimpleKey)\.?/g;
my @keys;
for my $seg (@segs) {
$seg = $self->tokenize_string($seg) if $seg =~ m/^['"]/;
push @keys, $seg;
}
return \@keys;
}
sub tokenize_float {
$_[1] =~ tr/_//d;
$_[1];
}
sub tokenize_integer {
$_[1] =~ tr/_+//d;
$_[1];
}
sub tokenize_string {
my $self = shift;
my $toml = shift;
my $ml = index($toml, q{'''}) == 0
|| index($toml, q{"""}) == 0;
my $lit = index($toml, q{'}) == 0;
my $str = '';
if ($ml) {
$str = substr $toml, 3, length($toml) - 6;
my @newlines = $str =~ /($CRLF)/g;
$self->{line} += scalar @newlines;
$str =~ s/^$WS* $CRLF//x; # trim leading whitespace
$str =~ s/\\$EOL\s*//xgs; # trim newlines from lines ending in backslash
} else {
$str = substr($toml, 1, length($toml) - 2);
}
if (!$lit) {
$str = $self->unescape_str($str);
}
return $str;
}
sub unescape_chars {
state $esc = {
'\b' => "\x08",
'\t' => "\x09",
'\n' => "\x0A",
'\f' => "\x0C",
'\r' => "\x0D",
'\"' => "\x22",
'\/' => "\x2F",
'\\\\' => "\x5C",
};
if (exists $esc->{$_[0]}) {
return $esc->{$_[0]};
}
my $hex = hex substr($_[0], 2);
if ($hex < 0x10FFFF && charnames::viacode($hex)) {
return chr $hex;
}
return;
}
sub unescape_str {
state $re = qr/($Escape)/;
$_[1] =~ s|$re|unescape_chars($1) // $_[0]->error(undef, "invalid unicode escape: $1")|xge;
$_[1];
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
TOML::Tiny::Tokenizer - tokenizer used by TOML::Tiny
=head1 VERSION
version 0.22
=head1 AUTHOR
Jeff Ober
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2026 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
valid 000755 001750 001751 0 15210037321 15364 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test example.t 100644 001750 001751 14021 15210037321 17362 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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;
bool 000755 001750 001751 0 15210037321 16317 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid bool.t 100644 001750 001751 2377 15210037321 17610 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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;
key 000755 001750 001751 0 15210037321 16154 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid empty.t 100644 001750 001751 2352 15210037321 17641 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; space.t 100644 001750 001751 4445 15210037321 17603 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; string 000755 001750 001751 0 15210037321 16672 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid nl.t 100644 001750 001751 2630 15210037321 17631 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; key 000755 001750 001751 0 15210037321 16503 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid hash.t 100644 001750 001751 627 15210037321 17740 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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-file.t 100644 001750 001751 2303 15210037321 17762 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 2421 15210037321 17750 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 133 15210037321 20031 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid best-day-ever = 1987-07-05T17:45:00Z
[numtheory]
boring = false
perfection = [6, 28, 496]
dotted.t 100644 001750 001751 70274 15210037321 20016 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; float 000755 001750 001751 0 15210037321 16471 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid long.t 100644 001750 001751 7155 15210037321 17765 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 21400 15210037321 20012 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 3322 15210037321 20010 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; array 000755 001750 001751 0 15210037321 16502 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid bool.t 100644 001750 001751 2466 15210037321 17772 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; empty.t 100644 001750 001751 631 15210037321 20146 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; space.t 100644 001750 001751 631 15210037321 20103 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; table 000755 001750 001751 0 15210037321 16453 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid names.t 100644 001750 001751 4153 15210037321 20106 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; empty.t 100644 001750 001751 2356 15210037321 20144 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; numeric.t 100644 001750 001751 4413 15210037321 20145 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 3117 15210037321 20126 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; float.t 100644 001750 001751 13500 15210037321 20142 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; array.t 100644 001750 001751 26154 15210037321 20175 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; empty.t 100644 001750 001751 3004 15210037321 20162 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; escape.t 100644 001750 001751 633 15210037321 20252 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; no-eol.t 100644 001750 001751 633 15210037321 20203 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; newline-crlf.t 100644 001750 001751 2432 15210037321 20277 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; bool.toml 100644 001750 001751 23 15210037321 20242 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/bool t = true
f = false
no-eol.t 100644 001750 001751 2366 15210037321 20200 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; integer 000755 001750 001751 0 15210037321 17021 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid long.t 100644 001750 001751 7344 15210037321 20315 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 34070 15210037321 20351 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; alphanum.t 100644 001750 001751 10110 15210037321 20317 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 15 15210037321 20303 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/key "" = "blank"
space.toml 100644 001750 001751 12 15210037321 20235 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/key "a b" = 1
nl.toml 100644 001750 001751 163 15210037321 20320 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/string nl_mid = "val\nue"
nl_end = """value\n"""
lit_nl_end = '''value\n'''
lit_nl_mid = 'val\nue'
lit_nl_uni = 'val\ue'
empty.t 100644 001750 001751 2367 15210037321 20365 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; nested.t 100644 001750 001751 2706 15210037321 20316 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; table 000755 001750 001751 0 15210037321 17002 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid empty.t 100644 001750 001751 635 15210037321 20451 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; newline.t 100644 001750 001751 635 15210037321 20455 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 7 15210037321 20400 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key a# = 1
empty-file.toml 100644 001750 001751 0 15210037321 20402 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid newline-lf.toml 100644 001750 001751 33 15210037321 20415 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid os = "unix"
newline = "lf"
keyword.t 100644 001750 001751 2517 15210037321 20471 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; dotted.toml 100644 001750 001751 1027 15210037321 20474 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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
long.toml 100644 001750 001751 72 15210037321 20424 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/float longpi = 3.141592653589793
neglongpi = -3.141592653589793
zero.toml 100644 001750 001751 104 15210037321 20460 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/float f1 = 0.0
f2 = +0.0
f3 = -0.0
f4 = 0e0
f5 = 0e00
f6 = +0e0
f7 = -0e0
simple.t 100644 001750 001751 2436 15210037321 20515 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 565 15210037321 20506 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/string backspace = 'This string has a \b backspace character.'
tab = 'This string has a \t tab character.'
newline = 'This string has a \n new line character.'
formfeed = 'This string has a \f form feed character.'
carriage = 'This string has a \r carriage return character.'
slash = 'This string has a \/ slash character.'
backslash = 'This string has a \\ backslash character.'
bool.toml 100644 001750 001751 22 15210037321 20424 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/array a = [true, false]
strings.t 100644 001750 001751 2730 15210037321 20522 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; empty.toml 100644 001750 001751 5 15210037321 20611 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key = 1
space.toml 100644 001750 001751 10 15210037321 20562 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key a b = 1
spec-example-1.t 100644 001750 001751 26634 15210037321 20465 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; names.toml 100644 001750 001751 132 15210037321 20567 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 4 15210037321 20560 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/table [a]
datetime 000755 001750 001751 0 15210037321 17160 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid local.t 100644 001750 001751 2567 15210037321 20611 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; escapes.toml 100644 001750 001751 225 15210037321 20613 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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"]
numeric.toml 100644 001750 001751 6 15210037321 20567 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/key 1 = 1
exponent.t 100644 001750 001751 24732 15210037321 20706 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; float.toml 100644 001750 001751 73 15210037321 20573 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/float pi = 3.14
pospi = +3.14
negpi = -3.14
zero-intpart = 0.123
escapes.t 100644 001750 001751 4314 15210037321 20644 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 25 15210037321 20632 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/array thevoid = [[[[[]]]]]
nospaces.t 100644 001750 001751 11272 15210037321 20665 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 315 15210037321 20634 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/array ints = [1, 2, 3, ]
floats = [1.1, 2.1, 3.1]
strings = ["a", "b", "c"]
dates = [
1987-07-05T17:45:00Z,
1979-05-27T07:32:00Z,
2006-06-01T11:00:00Z,
]
comments = [
1,
2, #this is ok
]
comment 000755 001750 001751 0 15210037321 17026 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid at-eof.t 100644 001750 001751 2401 15210037321 20523 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 33264 15210037321 20710 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; llbrace.t 100644 001750 001751 641 15210037321 20714 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 641 15210037321 20730 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; datetime 000755 001750 001751 0 15210037321 17507 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid no-t.t 100644 001750 001751 641 15210037321 20672 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; multiline.t 100644 001750 001751 641 15210037321 21013 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; no-eol.toml 100644 001750 001751 14 15210037321 20664 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key a = 1 b = 2
duplicate.t 100644 001750 001751 641 15210037321 20763 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; escape.toml 100644 001750 001751 55 15210037321 20740 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key \u00c0 = "latin capital letter A with grave"
implicit-groups.t 100644 001750 001751 6003 15210037321 21037 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 36 15210037321 20745 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid os = "DOS"
newline = "crlf"
no-eol.toml 100644 001750 001751 10 15210037321 20630 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/table [table]
sub-empty.t 100644 001750 001751 2467 15210037321 20736 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; array-one.t 100644 001750 001751 2721 15210037321 20677 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; integer.t 100644 001750 001751 13540 15210037321 21026 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; long.toml 100644 001750 001751 105 15210037321 20771 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/integer int64-max = 9223372036854775807
int64-max-neg = -9223372036854775808
zero.toml 100644 001750 001751 172 15210037321 21015 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/integer d1 = 0
d2 = +0
d3 = -0
h1 = 0x0
h2 = 0x00
h3 = 0x00000
o1 = 0o0
a2 = 0o00
a3 = 0o00000
b1 = 0b0
b2 = 0b00
b3 = 0b00000
alphanum.toml 100644 001750 001751 255 15210037322 21001 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/key alpha = "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.t 100644 001750 001751 23704 15210037322 21000 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; empty.toml 100644 001750 001751 14 15210037322 21021 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/string answer = ""
nested.toml 100644 001750 001751 26 15210037322 20760 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/array nest = [["a"], ["b"]]
at-eof2.t 100644 001750 001751 2405 15210037322 20612 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; encoding 000755 001750 001751 0 15210037322 17502 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid utf16.t 100644 001750 001751 643 15210037322 20757 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; empty.toml 100644 001750 001751 3 15210037322 21107 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/table []
redefine.t 100644 001750 001751 643 15210037322 21074 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; newline.toml 100644 001750 001751 21 15210037322 21133 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key barekey
= 123
two-equals.t 100644 001750 001751 643 15210037322 21115 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; array 000755 001750 001751 0 15210037322 17032 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid tables-1.t 100644 001750 001751 643 15210037322 20752 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; no-close.t 100644 001750 001751 643 15210037322 21061 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; tables-2.t 100644 001750 001751 643 15210037322 20753 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; array-nest.t 100644 001750 001751 4541 15210037322 21072 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; keyword.toml 100644 001750 001751 40 15210037322 21127 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/table [true]
[false]
[inf]
[nan]
whitespace.t 100644 001750 001751 2412 15210037322 21134 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; with-pound.t 100644 001750 001751 5327 15210037322 21106 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; array-many.t 100644 001750 001751 3456 15210037322 21071 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; literals.t 100644 001750 001751 26364 15210037322 21221 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; special-word.t 100644 001750 001751 7014 15210037322 21075 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; underscore.t 100644 001750 001751 11337 15210037322 21215 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; simple.toml 100644 001750 001751 57 15210037322 21163 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/string answer = "You are not drinking enough whisky."
strings.toml 100644 001750 001751 103 15210037322 21203 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/array string_array = [ "all", 'strings', """are the same""", '''type''']
bool 000755 001750 001751 0 15210037322 16647 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid mixed-case.t 100644 001750 001751 645 15210037322 21200 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; duplicate.t 100644 001750 001751 645 15210037322 21267 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; two-equals3.t 100644 001750 001751 645 15210037322 21202 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; two-equals2.t 100644 001750 001751 645 15210037322 21201 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 645 15210037322 21233 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; after-table.t 100644 001750 001751 645 15210037322 21204 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; after-value.t 100644 001750 001751 645 15210037322 21231 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; string 000755 001750 001751 0 15210037322 17222 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid no-close.t 100644 001750 001751 645 15210037322 21253 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; spec-example-1.toml 100644 001750 001751 1057 15210037322 21146 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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"
]
timezone.t 100644 001750 001751 2675 15210037322 21352 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 2520 15210037322 21301 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 130 15210037322 21262 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/datetime local = 1987-07-05T17:45:00
milli = 1977-12-21T10:32:00.555
space = 1987-07-05 17:45:00
inline-table 000755 001750 001751 0 15210037322 17730 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid bool.t 100644 001750 001751 2540 15210037322 21211 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 30242 15210037322 21247 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 5607 15210037322 21230 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; exponent.toml 100644 001750 001751 162 15210037322 21346 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/float lower = 3e2
upper = 3E2
neg = 3e-2
pos = 3E+2
zero = 3e0
pointlower = 3.1e2
pointupper = 3.1E2
minustenth = -1E-1
inf-and-nan.t 100644 001750 001751 17606 15210037322 21137 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; escapes.toml 100644 001750 001751 1403 15210037322 21351 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/string backspace = "This string has a \b backspace character."
tab = "This string has a \t tab character."
newline = "This string has a \n new line character."
formfeed = "This string has a \f form feed character."
carriage = "This string has a \r carriage return character."
quote = "This string has a \" quote character."
backslash = "This string has a \\ backslash character."
notunicode1 = "This string does not have a unicode \\u escape."
notunicode2 = "This string does not have a unicode \u005Cu escape."
notunicode3 = "This string does not have a unicode \\u0075 escape."
notunicode4 = "This string does not have a unicode \\\u0075 escape."
delete = "This string has a \u007F delete control code."
unitseparator = "This string has a \u001F unit separator control code."
with-pound.t 100644 001750 001751 2554 15210037322 21324 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; nospaces.toml 100644 001750 001751 17 15210037322 21311 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/array ints = [1,2,3]
tricky.toml 100644 001750 001751 601 15210037322 21346 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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 = { "#" = '}#'}#}}
at-eof.toml 100644 001750 001751 125 15210037322 21215 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/comment # This is a full-line comment
key = "value" # This is a comment at the end of a line
control 000755 001750 001751 0 15210037322 17374 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid multi-lf.t 100644 001750 001751 647 15210037322 21441 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; multi-us.t 100644 001750 001751 647 15210037322 21467 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; whitespace.t 100644 001750 001751 647 15210037322 21453 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; with-pound.t 100644 001750 001751 647 15210037322 21415 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; llbrace.toml 100644 001750 001751 13 15210037322 21376 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/table [ [table]]
rrbrace.toml 100644 001750 001751 13 15210037322 21412 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/table [[table] ]
no-t.toml 100644 001750 001751 33 15210037322 21356 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/datetime no-t = 1987-07-0517:45:00Z
no-secs.t 100644 001750 001751 647 15210037322 21373 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; open-bracket.t 100644 001750 001751 647 15210037322 21372 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; multiline.toml 100644 001750 001751 23 15210037322 21476 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key """long
key""" = 1
duplicate.toml 100644 001750 001751 57 15210037322 21455 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key # DO NOT DO THIS
name = "Tom"
name = "Pradyun"
float 000755 001750 001751 0 15210037322 17021 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid leading-us.t 100644 001750 001751 647 15210037322 21365 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; no-close-2.t 100644 001750 001751 647 15210037322 21224 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; implicit-groups.toml 100644 001750 001751 24 15210037322 21505 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid [a.b.c]
answer = 42
array-one.toml 100644 001750 001751 72 15210037322 21345 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/table [[people]]
first_name = "Bruce"
last_name = "Springsteen"
sub-empty.toml 100644 001750 001751 12 15210037322 21367 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/table [a]
[a.b]
integer.toml 100644 001750 001751 65 15210037322 21455 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/integer answer = 42
posanswer = +42
neganswer = -42
zero = 0
underscore.t 100644 001750 001751 6635 15210037322 21532 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; array.t 100644 001750 001751 3466 15210037322 21404 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; empty.t 100644 001750 001751 12235 15210037322 21436 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; numeric-dotted.t 100644 001750 001751 4760 15210037322 21434 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; quoted-dots.toml 100644 001750 001751 160 15210037322 21437 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/key plain = 1
"with.dot" = 2
[plain_table]
plain = 3
"with.dot" = 4
[table.withdot]
plain = 5
"key.with.dots" = 6
case-sensitive.t 100644 001750 001751 3443 15210037322 21430 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; equals-nospace.t 100644 001750 001751 4576 15210037322 21436 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; hetergeneous.t 100644 001750 001751 14466 15210037322 21560 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 125 15210037322 21277 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/comment # This is a full-line comment
key = "value" # This is a comment at the end of a line
everywhere.t 100644 001750 001751 12771 15210037322 21571 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; utf16.toml 100644 001750 001751 52 15210037322 21441 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/encoding # U T F - 1 6 w i t h o u t B O M
string-us.t 100644 001750 001751 651 15210037322 21636 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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-bs.t 100644 001750 001751 651 15210037322 21613 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; string-lf.t 100644 001750 001751 651 15210037322 21610 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; multi-del.t 100644 001750 001751 651 15210037322 21577 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; equals-sign.t 100644 001750 001751 651 15210037322 21542 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 651 15210037322 21564 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; redefine.toml 100644 001750 001751 116 15210037322 21577 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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
integer 000755 001750 001751 0 15210037322 17351 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid double-us.t 100644 001750 001751 651 15210037322 21557 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; no-leads.t 100644 001750 001751 651 15210037322 21521 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; two-equals.toml 100644 001750 001751 11 15210037322 21572 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key key= = 1
start-bracket.t 100644 001750 001751 651 15210037322 21561 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; trailing-us.t 100644 001750 001751 651 15210037322 21566 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 651 15210037322 21411 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 651 15210037322 21412 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; bad-escape.t 100644 001750 001751 651 15210037322 21515 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 651 15210037322 21524 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; tables-1.toml 100644 001750 001751 67 15210037322 21442 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/array # INVALID TOML DOC
fruit = []
[[fruit]] # Not allowed
no-close.toml 100644 001750 001751 27 15210037322 21545 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/array long_array = [ 1, 2, 3
tables-2.toml 100644 001750 001751 274 15210037322 21463 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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"
whitespace.toml 100644 001750 001751 16 15210037322 21602 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/table ["valid key"]
array-many.toml 100644 001750 001751 243 15210037322 21550 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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"
without-super.t 100644 001750 001751 2757 15210037322 21653 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 406 15210037322 21556 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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"
with-pound.toml 100644 001750 001751 32 15210037322 21542 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/table ["key#group"]
answer = 42
literals.toml 100644 001750 001751 227 15210037322 21657 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/integer bin1 = 0b11010110
bin2 = 0b1_0_1
oct1 = 0o01234567
oct2 = 0o755
oct3 = 0o7_6_5
hex1 = 0xDEADBEEF
hex2 = 0xdeadbeef
hex3 = 0xdead_beef
hex4 = 0x00987
local-time.t 100644 001750 001751 2522 15210037322 21535 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 2442 15210037322 21515 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 111 15210037322 21554 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/key false = false
true = 1
inf = 100000000
nan = "ceci n'est pas un nombre"
underscore.toml 100644 001750 001751 70 15210037322 21635 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/float before = 3_141.5927
after = 3141.592_7
exponent = 3e1_4
nested-double.t 100644 001750 001751 12330 15210037322 21601 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; mixed-case.toml 100644 001750 001751 16 15210037322 21660 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/bool valid = False
utf16-bom.t 100644 001750 001751 653 15210037322 21533 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; comment-us.t 100644 001750 001751 653 15210037322 21774 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; comment-lf.t 100644 001750 001751 653 15210037322 21746 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 653 15210037322 21755 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; multi-null.t 100644 001750 001751 653 15210037322 22007 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; duplicate.toml 100644 001750 001751 25 15210037322 21747 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/table [a]
b = 1
[a]
c = 2
leading-us.t 100644 001750 001751 653 15210037322 21712 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; inline-table 000755 001750 001751 0 15210037322 20257 5 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid empty.t 100644 001750 001751 653 15210037322 21726 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; two-equals3.toml 100644 001750 001751 6 15210037322 21641 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key a=b=1
after-table.toml 100644 001750 001751 44 15210037322 21665 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key [error] this = "should not be here"
duplicate-keys.t 100644 001750 001751 653 15210037322 21740 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; partial-quoted.t 100644 001750 001751 653 15210037322 21750 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; after-value.toml 100644 001750 001751 60 15210037322 21710 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key first = "Tom" last = "Preston-Werner" # INVALID
after-array.toml 100644 001750 001751 40 15210037322 21710 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key [[agencies]] owner = "S Cjelli"
two-equals2.toml 100644 001750 001751 5 15210037322 21637 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key a==1
leading-zero.t 100644 001750 001751 653 15210037322 21712 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; no-close.toml 100644 001750 001751 52 15210037322 21733 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string no-ending-quote = "One time, at band camp
bad-uni-esc.t 100644 001750 001751 653 15210037322 21622 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; wrong-close.t 100644 001750 001751 653 15210037322 21772 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; array-implicit.t 100644 001750 001751 3042 15210037322 21726 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; datetime.toml 100644 001750 001751 72 15210037322 21751 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/datetime space = 1987-07-05 17:45:00Z
lower = 1987-07-05t17:45:00z
timezone.toml 100644 001750 001751 206 15210037322 22026 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/datetime utc = 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
bool.toml 100644 001750 001751 32 15210037322 21653 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/inline-table a = {a = true, b = false}
nest.toml 100644 001750 001751 564 15210037322 21723 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/inline-table tbl_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 } ] ]
special-chars.toml 100644 001750 001751 52 15210037322 21665 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/key "~!@$^&*()_+-`1234567890[]|/?><.,;:'" = 1
inf-and-nan.toml 100644 001750 001751 350 15210037322 21573 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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
raw-multiline.t 100644 001750 001751 2752 15210037322 22017 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; with-pound.toml 100644 001750 001751 161 15210037322 22004 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/string pound = "We see no # comments here."
poundcomment = "But there are # some comments here." # Did I # mess you up?
escape-tricky.t 100644 001750 001751 3260 15210037322 21764 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; comment-del.t 100644 001750 001751 655 15210037322 22113 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; multi-lf.toml 100644 001750 001751 27 15210037322 22121 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control multi-lf = """null"""
string-null.t 100644 001750 001751 655 15210037322 22165 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; rawmulti-lf.t 100644 001750 001751 655 15210037322 22152 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; rawmulti-us.t 100644 001750 001751 655 15210037322 22200 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; multi-us.toml 100644 001750 001751 27 15210037322 22147 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control multi-us = """null"""
whitespace.toml 100644 001750 001751 16 15210037322 22131 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/table [invalid key]
with-pound.toml 100644 001750 001751 30 15210037322 22067 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/table [key#group]
answer = 42
trailing-us.t 100644 001750 001751 655 15210037322 22122 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 655 15210037322 22047 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; invalid-bin.t 100644 001750 001751 655 15210037322 22060 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 655 15210037322 22075 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; capital-oct.t 100644 001750 001751 655 15210037322 22064 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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-hex.t 100644 001750 001751 655 15210037322 22074 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; capital-hex.t 100644 001750 001751 655 15210037322 22063 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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-t.t 100644 001750 001751 655 15210037322 22075 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 34 15210037322 22051 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/datetime no-secs = 1987-07-05T17:45Z
without-value-2.t 100644 001750 001751 655 15210037322 21773 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; without-value-1.t 100644 001750 001751 655 15210037322 21772 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 11 15210037322 22043 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key [abc = 1
exp-double-us.t 100644 001750 001751 655 15210037322 22025 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 655 15210037322 22066 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; leading-us.toml 100644 001750 001751 22 15210037322 22040 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float leading-us = _1.2
text-in-array.t 100644 001750 001751 655 15210037322 22051 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; no-close-2.toml 100644 001750 001751 12 15210037322 21676 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/array x = [42 #
underscore.toml 100644 001750 001751 31 15210037322 22162 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/integer kilo = 1_000
x = 1_1_1_1
milliseconds.t 100644 001750 001751 2764 15210037322 22204 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.123456000Z",
"utc2" => "1987-07-05T17:45:56.600000000Z",
"wita1" => "1987-07-05T17:45:56.123456000+08:00",
"wita2" => "1987-07-05T17:45:56.600000000+08:00"
};
my $actual = from_toml($toml);
is($actual, $expected1, 'datetime/milliseconds - from_toml') or do{
diag 'TOML INPUT:';
diag "$toml";
diag '';
diag 'EXPECTED:';
diag Dumper($expected1);
diag '';
diag 'ACTUAL:';
diag Dumper($actual);
};
my $regenerated = to_toml $actual;
my $reparsed = eval{ scalar from_toml $regenerated };
my $error = $@;
ok(!$error, 'datetime/milliseconds - to_toml - no errors')
or diag $error;
is($reparsed, $expected1, 'datetime/milliseconds - to_toml') or do{
diag "ERROR: $error" if $error;
diag '';
diag 'PARSED FROM TEST SOURCE TOML:';
diag Dumper($actual);
diag '';
diag 'REGENERATED TOML:';
diag $regenerated;
diag '';
diag 'REPARSED FROM REGENERATED TOML:';
diag Dumper($reparsed);
};
done_testing; empty.toml 100644 001750 001751 235 15210037322 22103 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/inline-table empty1 = {}
empty2 = { }
empty_in_array = [ { not_empty = 1 }, {} ]
empty_in_array2 = [{},{not_empty=1}]
many_empty = [{},{},{}]
nested_empty = {"empty"={}}
array.toml 100644 001750 001751 252 15210037322 22062 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/inline-table people = [{first_name = "Bruce", last_name = "Springsteen"},
{first_name = "Eric", last_name = "Clapton"},
{first_name = "Bob", last_name = "Seger"}]
case-sensitive.toml 100644 001750 001751 313 15210037322 22111 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/key sectioN = "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.toml 100644 001750 001751 10 15210037322 22064 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/key 1.2 = 3
equals-nospace.toml 100644 001750 001751 12 15210037322 22063 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/key answer=42
unicode-escape.t 100644 001750 001751 2512 15210037322 22104 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 2440 15210037322 22062 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; mixed-int-float.t 100644 001750 001751 7742 15210037322 22043 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; mixed-int-array.t 100644 001750 001751 5443 15210037322 22050 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; hetergeneous.toml 100644 001750 001751 51 15210037322 22171 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/array mixed = [[1, 2], ["a", "b"], [1.1, 2.1]]
everywhere.toml 100644 001750 001751 1054 15210037322 22251 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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
wrong-case-true.t 100644 001750 001751 657 15210037322 22206 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; string-lf.toml 100644 001750 001751 24 15210037322 22272 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control string-lf = "null"
rawmulti-del.t 100644 001750 001751 657 15210037322 22317 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; multi-del.toml 100644 001750 001751 30 15210037322 22256 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control multi-del = """null"""
rawstring-us.t 100644 001750 001751 657 15210037322 22356 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; rawstring-lf.t 100644 001750 001751 657 15210037322 22330 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; string-bs.toml 100644 001750 001751 31 15210037322 22273 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control string-bs = "backspace"
string-us.toml 100644 001750 001751 24 15210037322 22320 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control string-us = "null"
comment-null.t 100644 001750 001751 657 15210037322 22323 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; array-empty.toml 100644 001750 001751 32 15210037322 22245 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/table [[]]
name = "Born to Run"
equals-sign.toml 100644 001750 001751 13 15210037322 22222 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/table [name=bad]
array-implicit.t 100644 001750 001751 657 15210037322 22246 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; positive-hex.t 100644 001750 001751 657 15210037322 22312 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; us-after-bin.t 100644 001750 001751 657 15210037322 22162 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; double-us.toml 100644 001750 001751 22 15210037322 22237 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer double-us = 1__23
us-after-oct.t 100644 001750 001751 657 15210037322 22177 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; positive-oct.t 100644 001750 001751 657 15210037322 22313 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 657 15210037322 22236 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; us-after-hex.t 100644 001750 001751 657 15210037322 22176 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; negative-hex.t 100644 001750 001751 657 15210037322 22252 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; positive-bin.t 100644 001750 001751 657 15210037322 22276 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; negative-oct.t 100644 001750 001751 657 15210037322 22253 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; no-leads.toml 100644 001750 001751 37 15210037322 22207 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/datetime no-leads = 1987-7-05T17:45:00Z
start-bracket.toml 100644 001750 001751 21 15210037322 22240 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key [a]
[xyz = 5
[b]
nan_underscore.t 100644 001750 001751 657 15210037322 22343 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 657 15210037322 22343 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; trailing-point.t 100644 001750 001751 657 15210037322 22276 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; double-point-2.t 100644 001750 001751 657 15210037322 22076 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; double-point-1.t 100644 001750 001751 657 15210037322 22075 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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-us.toml 100644 001750 001751 23 15210037322 22247 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float trailing-us = 1.2_
exp-double-e-1.t 100644 001750 001751 657 15210037322 21762 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; exp-point-1.toml 100644 001750 001751 24 15210037322 22073 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float exp-point-1 = 1e2.3
exp-double-e-2.t 100644 001750 001751 657 15210037322 21763 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; us-after-point.t 100644 001750 001751 657 15210037322 22213 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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-leading-us.t 100644 001750 001751 657 15210037322 22160 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 23 15210037322 22073 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float exp-point-2 = 1.e2
bad-escape.toml 100644 001750 001751 76 15210037322 22206 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string invalid-escape = "This string has a bad \a escape character."
bad-codepoint.t 100644 001750 001751 657 15210037322 22247 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 657 15210037322 22265 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; bad-concat.toml 100644 001750 001751 35 15210037322 22210 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string no_concat = "first" "second"
no-close-table.t 100644 001750 001751 657 15210037322 22153 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; spec-example-1-compact.t 100644 001750 001751 26674 15210037322 22116 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; without-super.toml 100644 001750 001751 170 15210037322 22326 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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
local-time.toml 100644 001750 001751 64 15210037322 22204 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/datetime besttimeever = 17:45:00
milliseconds = 10:32:00.555
local-date.toml 100644 001750 001751 31 15210037322 22155 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/datetime bestdayever = 1987-07-05
multiline.t 100644 001750 001751 10376 15210037322 22306 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; unicode-literal.t 100644 001750 001751 2446 15210037322 22306 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; nested-double.toml 100644 001750 001751 50 15210037322 22225 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/array nest = [
[
["a"],
[1, 2, [3]]
]
]
mixed-int-string.t 100644 001750 001751 5325 15210037322 22237 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; wrong-case-false.t 100644 001750 001751 661 15210037322 22314 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; utf16-bom.toml 100644 001750 001751 46 15210037322 22217 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/encoding þÿ # U T F - 1 6 w i t h B O M
multi-null.toml 100644 001750 001751 31 15210037322 22465 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control multi-null = """null """
comment-lf.toml 100644 001750 001751 32 15210037322 22425 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control comment-lf = "ctrl-P" #
rawmulti-null.t 100644 001750 001751 661 15210037322 22520 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; rawstring-del.t 100644 001750 001751 661 15210037322 22466 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; comment-us.toml 100644 001750 001751 32 15210037322 22453 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control comment-us = "ctrl-_" #
string-del.toml 100644 001750 001751 25 15210037322 22436 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control string-del = "null"
quoted-no-close.t 100644 001750 001751 661 15210037322 22331 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; leading-us.toml 100644 001750 001751 22 15210037322 22370 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer leading-us = _123
empty.toml 100644 001750 001751 10 15210037322 22401 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/inline-table t = {,}
no-comma.t 100644 001750 001751 661 15210037322 22275 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; duplicate-keys.toml 100644 001750 001751 31 15210037322 22416 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key dupe = false
dupe = true
partial-quoted.toml 100644 001750 001751 24 15210037322 22430 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key partial"quoted" = 5
special-character.t 100644 001750 001751 661 15210037322 22366 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; us-before-point.t 100644 001750 001751 661 15210037322 22347 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; exp-trailing-us.t 100644 001750 001751 661 15210037322 22361 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 25 15210037322 22373 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float leading-zero = 03.14
wrong-close.toml 100644 001750 001751 47 15210037322 22457 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string bad-ending-quote = "double and single'
missing-quotes.t 100644 001750 001751 661 15210037322 22521 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 17 15210037322 22304 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string str = "val\ue"
array-implicit.toml 100644 001750 001751 45 15210037322 22376 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/table [[albums.songs]]
name = "Glory Days"
array-table-array.t 100644 001750 001751 3564 15210037322 22330 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; key-dotted.t 100644 001750 001751 70026 15210037322 22353 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; multiline-quotes.t 100644 001750 001751 3335 15210037322 22544 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; raw-multiline.toml 100644 001750 001751 303 15210037322 22475 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/string oneline = '''This string has a ' quote character.'''
firstnl = '''
This string has a ' quote character.'''
multiline = '''
This string
has ' a quote character
and more than
one newline
in it.'''
escape-tricky.toml 100644 001750 001751 510 15210037322 22447 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/string end_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\'''
string-with-comma.t 100644 001750 001751 2635 15210037322 22407 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; rawstring-null.t 100644 001750 001751 663 15210037322 22676 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; rawmulti-us.toml 100644 001750 001751 32 15210037322 22655 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control rawmulti-us = '''null'''
string-null.toml 100644 001750 001751 26 15210037322 22645 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control string-null = "null "
comment-del.toml 100644 001750 001751 31 15210037322 22567 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control comment-del = "0x7f" #
rawmulti-lf.toml 100644 001750 001751 32 15210037322 22627 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control rawmulti-lf = '''null'''
text-after-table.t 100644 001750 001751 663 15210037322 22465 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; leading-us-bin.t 100644 001750 001751 663 15210037322 22461 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; capital-oct.toml 100644 001750 001751 22 15210037322 22540 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer capital-oct = 0O0
leading-zero-2.t 100644 001750 001751 663 15210037322 22402 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; leading-us-oct.t 100644 001750 001751 663 15210037322 22476 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; capital-hex.toml 100644 001750 001751 22 15210037322 22537 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer capital-hex = 0X1
leading-zero-1.t 100644 001750 001751 663 15210037322 22401 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; leading-us-hex.t 100644 001750 001751 663 15210037322 22475 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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-hex.toml 100644 001750 001751 25 15210037322 22553 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer invalid-hex = 0xaafz
trailing-us.toml 100644 001750 001751 23 15210037322 22577 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer trailing-us = 123_
invalid-bin.toml 100644 001750 001751 25 15210037322 22537 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer invalid-bin = 0b0012
capital-bin.toml 100644 001750 001751 22 15210037322 22523 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer capital-bin = 0B0
invalid-oct.toml 100644 001750 001751 24 15210037322 22553 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer invalid-oct = 0o778
trailing-t.toml 100644 001750 001751 20 15210037322 22547 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/datetime d = 2006-01-30T
without-value-1.toml 100644 001750 001751 4 15210037322 22426 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key key
without-value-2.toml 100644 001750 001751 7 15210037322 22432 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key key =
inf-incomplete-1.t 100644 001750 001751 663 15210037322 22402 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; nan-incomplete-2.t 100644 001750 001751 663 15210037322 22403 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; inf-incomplete-2.t 100644 001750 001751 663 15210037322 22403 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 663 15210037322 22404 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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-3.t 100644 001750 001751 663 15210037322 22404 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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-1.t 100644 001750 001751 663 15210037322 22402 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; leading-zero-neg.t 100644 001750 001751 663 15210037322 22462 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; leading-point.toml 100644 001750 001751 27 15210037322 22547 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float leading-point = .12345
exp-double-us.toml 100644 001750 001751 27 15210037322 22506 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float exp-double-us = 1e__23
bad-byte-escape.t 100644 001750 001751 663 15210037322 22461 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; no-close-table-2.t 100644 001750 001751 663 15210037322 22307 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 70 15210037322 22530 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/array array = [
"Entry 1",
I don't belong,
"Entry 2",
]
with-single-quotes.t 100644 001750 001751 6047 15210037322 22560 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; milliseconds.toml 100644 001750 001751 220 15210037322 22655 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/datetime utc1 = 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.t 100644 001750 001751 2733 15210037322 22365 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; unicode-escape.toml 100644 001750 001751 52 15210037322 22551 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/string answer4 = "\u03B4"
answer8 = "\U000003B4"
escaped-escape.toml 100644 001750 001751 21 15210037322 22523 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/string answer = "\\x64"
mixed-string-table.t 100644 001750 001751 3246 15210037322 22534 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; string-quote-comma.t 100644 001750 001751 2645 15210037322 22572 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; mixed-int-array.toml 100644 001750 001751 65 15210037322 22513 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/array arrays-and-ints = [1, ["Arrays are not integers."]]
mixed-int-float.toml 100644 001750 001751 33 15210037322 22475 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/array ints-and-floats = [1, 1.1]
wrong-case-true.toml 100644 001750 001751 11 15210037322 22656 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/bool a = TRUE
comment-null.toml 100644 001750 001751 32 15210037322 22776 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control comment-null = "null" #
rawmulti-del.toml 100644 001750 001751 33 15210037322 22773 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control rawmulti-del = '''null'''
rawstring-lf.toml 100644 001750 001751 27 15210037322 23007 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control rawstring-lf = 'null'
rawstring-us.toml 100644 001750 001751 27 15210037322 23035 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control rawstring-us = 'null'
array-implicit.toml 100644 001750 001751 1156 15210037322 22771 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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"
positive-bin.toml 100644 001750 001751 33 15210037322 22752 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer positive-bin = +0b11010110
positive-hex.toml 100644 001750 001751 25 15210037322 22767 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer positive-hex = +0xff
trailing-us-hex.t 100644 001750 001751 665 15210037322 22705 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; positive-oct.toml 100644 001750 001751 25 15210037322 22770 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer positive-oct = +0o99
double-sign-nex.t 100644 001750 001751 665 15210037322 22665 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; negative-oct.toml 100644 001750 001751 25 15210037322 22730 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer negative-oct = -0o99
negative-hex.toml 100644 001750 001751 25 15210037322 22727 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer negative-hex = -0xff
trailing-us-bin.t 100644 001750 001751 665 15210037322 22671 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 665 15210037322 22706 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; us-after-oct.toml 100644 001750 001751 24 15210037322 22653 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer us-after-oct = 0o_1
us-after-bin.toml 100644 001750 001751 24 15210037322 22636 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer us-after-bin = 0b_1
us-after-hex.toml 100644 001750 001751 24 15210037322 22652 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer us-after-hex = 0x_1
negative-bin.toml 100644 001750 001751 33 15210037322 22712 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer negative-bin = -0b11010110
single-open-bracket.t 100644 001750 001751 665 15210037322 22651 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; double-point-2.toml 100644 001750 001751 27 15210037322 22555 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float double-point-2 = 0.1.2
exp-double-e-2.toml 100644 001750 001751 27 15210037322 22442 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float exp-double-e-2 = 1e2e3
exp-leading-us.toml 100644 001750 001751 27 15210037322 22637 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float exp-leading-us = 1e_23
leading-point-neg.t 100644 001750 001751 665 15210037322 22636 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; double-point-1.toml 100644 001750 001751 26 15210037322 22553 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float double-point-1 = 0..1
leading-zero-plus.t 100644 001750 001751 665 15210037322 22676 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; nan_underscore.toml 100644 001750 001751 26 15210037322 23021 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float nan_underscore = na_n
us-after-point.toml 100644 001750 001751 26 15210037322 22671 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float us-after-point = 1._2
inf_underscore.toml 100644 001750 001751 26 15210037322 23021 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float inf_underscore = in_f
exp-double-e-1.toml 100644 001750 001751 26 15210037322 22440 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float exp-double-e-1 = 1ee2
trailing-point.toml 100644 001750 001751 24 15210037322 22752 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float trailing-point = 1.
bad-multiline.toml 100644 001750 001751 41 15210037322 22740 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string multi = "first line
second line"
bad-slash-escape.t 100644 001750 001751 665 15210037322 22632 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 121 15210037322 22741 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string invalid-codepoint = "This string contains a non scalar unicode codepoint \uD801"
missing-separator.t 100644 001750 001751 665 15210037322 23015 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 20 15210037322 22623 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/array x = [{ key = 42
spec-example-1-compact.toml 100644 001750 001751 570 15210037322 22551 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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"
]
with-literal-string.t 100644 001750 001751 6177 15210037322 22725 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; inline-table.t 100644 001750 001751 23343 15210037322 22645 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; multiline.toml 100644 001750 001751 130 15210037322 22741 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/inline-table tbl_multiline = { a = 1, b = """
multiline
""", c = """and yet
another line""", d = 4 }
unicode-literal.toml 100644 001750 001751 16 15210037322 22745 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/string answer = "δ"
mixed-int-string.toml 100644 001750 001751 36 15210037322 22701 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/array strings-and-ints = ["hi", 42]
nested-inline-table.t 100644 001750 001751 2625 15210037322 22660 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; wrong-case-false.toml 100644 001750 001751 12 15210037322 22772 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/bool b = FALSE
bad-utf8-at-end.t 100644 001750 001751 667 15210037322 22600 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; rawstring-del.toml 100644 001750 001751 30 15210037322 23144 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control rawstring-del = 'null'
rawmulti-null.toml 100644 001750 001751 34 15210037322 23202 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control rawmulti-null = '''null '''
quoted-no-close.toml 100644 001750 001751 42 15210037322 23012 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/table ["where will it end]
name = value
double-sign-plus.t 100644 001750 001751 667 15210037322 23060 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; impossible-date.t 100644 001750 001751 667 15210037322 23107 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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-2.t 100644 001750 001751 667 15210037322 22670 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 667 15210037322 22667 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; linebreak-4.t 100644 001750 001751 667 15210037322 22672 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 667 15210037322 22671 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; no-comma.toml 100644 001750 001751 22 15210037322 22754 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/inline-table t = {x = 3 y = 4}
special-character.toml 100644 001750 001751 35 15210037322 23051 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key μ = "greek small letter mu"
trailing-point-min.t 100644 001750 001751 667 15210037322 23060 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 27 15210037322 23033 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float us-before-point = 1_.2
leading-point-plus.t 100644 001750 001751 667 15210037322 23052 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; exp-trailing-us.toml 100644 001750 001751 31 15210037322 23040 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float exp-trailing-us = 1e_23_
missing-quotes.toml 100644 001750 001751 15 15210037322 23202 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string name = value
text-after-string.t 100644 001750 001751 667 15210037322 23127 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; array-table-array.toml 100644 001750 001751 154 15210037322 23010 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/table [[a]]
[[a.b]]
[a.b.c]
d = "val0"
[[a.b]]
[a.b.c]
d = "val1"
key-dotted.toml 100644 001750 001751 464 15210037322 23022 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/inline-table inline = {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}
multiline-quotes.toml 100644 001750 001751 700 15210037322 23225 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 2464 15210037322 23071 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; string-with-comma.toml 100644 001750 001751 64 15210037322 23051 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/array title = [
"Client: XXXX, Job: XXXX",
"Code: XXXX"
]
string-quote-comma-2.t 100644 001750 001751 2555 15210037322 22731 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; rawstring-null.toml 100644 001750 001751 31 15210037322 23353 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/control rawstring-null = 'null '
duplicate-key-table.t 100644 001750 001751 671 15210037322 23141 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; text-after-table.toml 100644 001750 001751 37 15210037322 23150 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/table [error] this shouldn't be here
leading-zero-2.toml 100644 001750 001751 24 15210037322 23061 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer leading-zero-2 = 00
leading-us-bin.toml 100644 001750 001751 26 15210037322 23142 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer leading-us-bin = _0o1
leading-us-oct.toml 100644 001750 001751 26 15210037322 23157 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer leading-us-oct = _0o1
leading-zero-1.toml 100644 001750 001751 24 15210037322 23060 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer leading-zero-1 = 01
leading-us-hex.toml 100644 001750 001751 26 15210037322 23156 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer leading-us-hex = _0o1
double-comma.t 100644 001750 001751 671 15210037322 23134 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 671 15210037322 23144 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; leading-zero-neg.toml 100644 001750 001751 32 15210037322 23140 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float leading-zero-neg = -03.14
inf-incomplete-1.toml 100644 001750 001751 26 15210037322 23063 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float inf-incomplete-1 = in
inf-incomplete-2.toml 100644 001750 001751 27 15210037322 23065 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float inf-incomplete-2 = +in
inf-incomplete-3.toml 100644 001750 001751 27 15210037322 23066 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float inf-incomplete-3 = -in
trailing-point-plus.t 100644 001750 001751 671 15210037322 23253 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; nan-incomplete-2.toml 100644 001750 001751 27 15210037322 23065 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float nan-incomplete-2 = +na
nan-incomplete-1.toml 100644 001750 001751 26 15210037322 23063 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float nan-incomplete-1 = na
nan-incomplete-3.toml 100644 001750 001751 27 15210037322 23066 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float nan-incomplete-3 = -na
bad-byte-escape.toml 100644 001750 001751 21 15210037322 23135 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string naughty = "\xAg"
multiline-quotes-1.t 100644 001750 001751 671 15210037322 23211 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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-no-close.t 100644 001750 001751 671 15210037322 23252 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; multiline-quotes-2.t 100644 001750 001751 671 15210037322 23212 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; basic-byte-escapes.t 100644 001750 001751 671 15210037322 23176 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; no-close-table-2.toml 100644 001750 001751 22 15210037322 22764 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/array x = [{ key = 42 #
implicit-and-explicit-after.t 100644 001750 001751 10532 15210037322 23223 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; with-single-quotes.toml 100644 001750 001751 45 15210037322 23220 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/table ['a']
[a.'b']
[a.'b'.c]
answer = 42
end-in-bool.toml 100644 001750 001751 106 15210037322 23045 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/inline-table black = { python=">3.6", version=">=18.9b0", allow_prereleases=true }
mixed-string-table.toml 100644 001750 001751 213 15210037322 23213 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/array contributors = [
"Foo Bar ",
{ name = "Baz Qux", email = "bazqux@example.com", url = "https://example.com/bazqux" }
]
string-quote-comma.toml 100644 001750 001751 70 15210037322 23230 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/array title = [
"Client: \"XXXX\", Job: XXXX",
"Code: XXXX"
]
empty-implicit-table.t 100644 001750 001751 673 15210037322 23351 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 673 15210037322 23333 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; double-sign-nex.toml 100644 001750 001751 27 15210037322 23345 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer double-sign-nex = --99
trailing-us-oct.toml 100644 001750 001751 27 15210037322 23366 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer trailing-us-oct = 0o1_
trailing-us-bin.toml 100644 001750 001751 27 15210037322 23351 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer trailing-us-bin = 0b1_
text-after-integer.t 100644 001750 001751 673 15210037322 23402 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; trailing-us-hex.toml 100644 001750 001751 27 15210037322 23365 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer trailing-us-hex = 0x1_
bare-invalid-character.t 100644 001750 001751 673 15210037322 23306 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 2 15210037322 23302 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key [
leading-zero-plus.toml 100644 001750 001751 33 15210037322 23353 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float leading-zero-plus = +03.14
leading-point-neg.toml 100644 001750 001751 34 15210037322 23314 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float leading-point-neg = -.12345
bad-slash-escape.toml 100644 001750 001751 76 15210037322 23316 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string invalid-escape = "This string has a bad \/ escape character."
missing-separator.toml 100644 001750 001751 22 15210037322 23470 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/array wrong = [ 1 2 3 ]
implicit-and-explicit-before.t 100644 001750 001751 10536 15210037322 23370 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; with-literal-string.toml 100644 001750 001751 51 15210037322 23356 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/table ['a']
[a.'"b"']
[a.'"b"'.c]
answer = 42
inline-table.toml 100644 001750 001751 235 15210037322 23310 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/inline-table name = { first = "Tom", last = "Preston-Werner" }
point = { x = 1, y = 2 }
simple = { a = 1 }
str-key = { "a" = 1 }
table-array = [{ "a" = 1 }, { "b" = 2 }]
nested-inline-table.toml 100644 001750 001751 23 15210037322 23316 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/array a = [ { b = {} } ]
bom-not-at-start-2.t 100644 001750 001751 675 15210037322 23266 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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-in-string.t 100644 001750 001751 675 15210037322 23341 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 675 15210037322 23265 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; bad-utf8-at-end.toml 100644 001750 001751 362 15210037322 23300 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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 = """"""Ú array-missing-bracket.t 100644 001750 001751 675 15210037322 23516 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 675 15210037322 23473 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; nested-brackets-close.t 100644 001750 001751 675 15210037322 23501 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; leading-zero-sign-1.t 100644 001750 001751 675 15210037322 23342 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; leading-zero-sign-2.t 100644 001750 001751 675 15210037322 23343 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; double-sign-plus.toml 100644 001750 001751 30 15210037322 23530 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer double-sign-plus = ++99
impossible-date.toml 100644 001750 001751 31 15210037322 23560 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/datetime d = 2006-01-50T00:00:00Z
linebreak-2.toml 100644 001750 001751 17 15210037322 23345 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/inline-table t = {a=1,
b=2}
linebreak-3.toml 100644 001750 001751 17 15210037322 23346 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/inline-table t = {a=1
,b=2}
linebreak-4.toml 100644 001750 001751 113 15210037322 23364 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/inline-table json_like = {
first = "Tom",
last = "Preston-Werner"
}
trailing-comma.t 100644 001750 001751 675 15210037322 23477 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; linebreak-1.toml 100644 001750 001751 157 15210037322 23371 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/inline-table # No newlines are allowed between the curly braces unless they are valid within
# a value.
simple = { a = 1
}
leading-point-plus.toml 100644 001750 001751 35 15210037322 23527 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float leading-point-plus = +.12345
trailing-point-min.toml 100644 001750 001751 31 15210037322 23531 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float trailing-point-min = -1.
text-after-string.toml 100644 001750 001751 54 15210037322 23605 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string string = "Is there life after strings?" No.
multiline-no-close-2.t 100644 001750 001751 675 15210037322 23415 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; basic-unknown-escape.t 100644 001750 001751 675 15210037322 23553 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; double-quote-escape.toml 100644 001750 001751 21 15210037322 23524 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/string test = "\"one\""
string-quote-comma-2.toml 100644 001750 001751 24 15210037322 23366 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/array title = [ " \", ",]
bad-utf8-in-comment.t 100644 001750 001751 677 15210037322 23477 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; duplicate-table-array2.t 100644 001750 001751 677 15210037322 23557 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 63 15210037322 23624 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/table [fruit]
type = "apple"
[fruit.type]
apple = "yes"
no-leads-with-milli.t 100644 001750 001751 677 15210037322 23606 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 17 15210037322 23616 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/inline-table t = {x=3,,y=4}
dotted-redefine-table.toml 100644 001750 001751 114 15210037322 23644 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key # Defined a.b as int
a.b = 1
# Tries to access it as table: error
a.b.c = 2
trailing-point-plus.toml 100644 001750 001751 32 15210037322 23732 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/float trailing-point-plus = +1.
multiline-quotes-2.toml 100644 001750 001751 30 15210037322 23667 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string a = """6 quotes: """"""
multiline-no-close.toml 100644 001750 001751 41 15210037322 23731 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string invalid = """
this will fail
multiline-quotes-1.toml 100644 001750 001751 30 15210037322 23666 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string a = """6 quotes: """"""
basic-byte-escapes.toml 100644 001750 001751 20 15210037322 23652 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string answer = "\x33"
implicit-and-explicit-after.toml 100644 001750 001751 45 15210037322 23651 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid [a.b.c]
answer = 42
[a]
better = 43
nested-brackets-open.toml 100644 001750 001751 17 15210037322 24013 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/table [a[b]
zyx = 42
empty-implicit-table.toml 100644 001750 001751 23 15210037322 24026 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/table [naughty..naughty]
text-after-integer.toml 100644 001750 001751 41 15210037322 24057 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer answer = 42 the ultimate answer?
bare-invalid-character.toml 100644 001750 001751 17 15210037322 23766 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/key bare!key = 123
multiline-escape-space.t 100644 001750 001751 701 15210037322 24056 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 701 15210037322 24124 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; implicit-and-explicit-before.toml 100644 001750 001751 45 15210037322 24012 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid [a]
better = 43
[a.b.c]
answer = 42
bom-not-at-start-2.toml 100644 001750 001751 25 15210037322 23743 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/encoding bom-not-at-start= ÿý
bom-not-at-start-1.toml 100644 001750 001751 24 15210037322 23741 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/encoding bom-not-at-start ÿý
bad-utf8-in-string.toml 100644 001750 001751 103 15210037322 24033 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/encoding # The following line contains an invalid UTF-8 sequence.
bad = "Ã"
nested-brackets-close.toml 100644 001750 001751 17 15210037322 24157 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/table [a]b]
zyx = 42
duplicate-table-array.toml 100644 001750 001751 16 15210037322 24150 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/table [tbl]
[[tbl]]
array-missing-bracket.toml 100644 001750 001751 37 15210037322 24176 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/table [[albums]
name = "Born to Run"
leading-zero-sign-2.toml 100644 001750 001751 32 15210037322 24016 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer leading-zero-sign-2 = +01
leading-zero-sign-1.toml 100644 001750 001751 32 15210037322 24015 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/integer leading-zero-sign-1 = -01
trailing-comma.toml 100644 001750 001751 214 15210037322 24174 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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, }
multiline-no-close-2.toml 100644 001750 001751 6 15210037322 24051 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string x="""
basic-unknown-escape.toml 100644 001750 001751 11 15210037322 24223 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string a = "\@"
text-after-array-entries.t 100644 001750 001751 703 15210037322 24205 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; bad-utf8-in-comment.toml 100644 001750 001751 4 15210037322 24127 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/encoding # Ã
duplicate-table-array2.toml 100644 001750 001751 16 15210037322 24232 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/table [[tbl]]
[tbl]
no-leads-with-milli.toml 100644 001750 001751 44 15210037322 24262 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/datetime with-milli = 1987-07-5T17:45:00.12Z
basic-multiline-quotes.toml 100644 001750 001751 62 15210037322 24614 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string str5 = """Here are three quotation marks: """."""
multiline-escape-space.toml 100644 001750 001751 34 15210037322 24545 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string a = """
foo \ \n
bar"""
table-array-string-backslash.t 100644 001750 001751 2720 15210037322 24471 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; literal-multiline-quotes-1.t 100644 001750 001751 711 15210037322 24636 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 711 15210037322 24637 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; text-after-array-entries.toml 100644 001750 001751 106 15210037322 24712 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/array array = [
"Is there life after an array separator?", No
"Entry"
]
text-before-array-separator.t 100644 001750 001751 711 15210037322 24674 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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; table-array-string-backslash.toml 100644 001750 001751 37 15210037322 25140 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/valid/array foo = [ { bar="\"{{baz}}\""} ]
literal-multiline-quotes-2.toml 100644 001750 001751 52 15210037322 25325 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string a = '''15 apostrophes: ''''''''''''''''''
literal-multiline-quotes-1.toml 100644 001750 001751 36 15210037322 25326 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string a = '''6 apostrophes: ''''''
text-before-array-separator.toml 100644 001750 001751 107 15210037322 25403 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/array array = [
"Is there life before an array separator?" No,
"Entry"
]
basic-multiline-unknown-escape.t 100644 001750 001751 721 15210037322 25543 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 15 15210037322 26227 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string a = """\@"""
basic-out-of-range-unicode-escape-1.t 100644 001750 001751 733 15210037322 26134 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 733 15210037322 26135 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.toml 100644 001750 001751 21 15210037322 26613 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string a = "\U00D80000"
basic-out-of-range-unicode-escape-1.toml 100644 001750 001751 21 15210037322 26612 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string a = "\UFFFFFFFF"
basic-multiline-out-of-range-unicode-escape-2.t 100644 001750 001751 757 15210037322 30143 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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.t 100644 001750 001751 757 15210037322 30142 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/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-2.toml 100644 001750 001751 25 15210037322 30617 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string a = """\U00D80000"""
basic-multiline-out-of-range-unicode-escape-1.toml 100644 001750 001751 25 15210037322 30616 0 ustar 00olaf olaf 000000 000000 TOML-Tiny-0.22/t/toml-test/invalid/string a = """\UFFFFFFFF"""