work/0000775000000000000000000000000014777226410006742 5ustar work/.dir-locals.el0000664000000000000000000000005414777226410011372 0ustar ((cperl-mode . ((cperl-indent-level . 2)))) work/.gitlab-ci.yml0000664000000000000000000000013714777226410011377 0ustar --- include: - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/recipes/debian.yml work/AGPL-30000664000000000000000000010333514777226410007555 0ustar GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 Copyright (C) 2007 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 GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), 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. Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software. A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public. The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version. An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU Affero General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey 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; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Remote Network Interaction; Use with the GNU General Public License. Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU Affero 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 that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. 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. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 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. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS 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 the public, 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 state 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) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see . work/DEVELOPER-CERTIFICATE0000664000000000000000000000261614777226410011737 0ustar Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 1 Letterman Drive Suite D4700 San Francisco, CA, 94129 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. work/LICENSE0000664000000000000000000000005314777226410007745 0ustar SPDX-License-Identifier: AGPL-3.0-or-later work/README.md0000664000000000000000000011016714777226410010227 0ustar nailing-cargo ============= This is a wrapper tool for cargo, the Rust build tool and package manager. Functions: * Perform out-of-tree builds, including in an account with no write access to the source tree. * Conveniently use local crates, including completely unpublished crates. * Provide convenience aliases for target architecture names. * Make the default be offline (ie, not to access the internet). These functions are of course configurable. A default method for out-of-tree builds is usually configured in `~/.nailing-cargo.toml`. To configure project-specific methods for out-of-tree builds, and to configure the use of local crates to override crates from `crates.io`, you will also need a `../Cargo.nail`, which is in TOML syntax. You put `Cargo.nail` alongside the top-level git repositories you are working with, and invoke nailing-cargo from the git directory containing the Rust package you want to build. Installing ---------- nailing-cargo is designed to be run out of a git clone: ``` $ git clone https://salsa.debian.org/iwj/nailing-cargo.git $ ln -s `pwd`/nailing-cargo/nailing-cargo ~/bin ``` It is self-contained, depending only on a reasonably functional Perl installation. Most basic example usage with nailing ------------------------------------- ``` $ cd myproject $ cat >../Cargo.nail subdirs=""" myproject mylibrary """ $ nailing-cargo -u fetch $ nailing-cargo build ``` Documentation table of contents ------------------------------- * [Introduction](#nailing-cargo) * [Installing](#installing) * [Most basic example usage with nailing](#most-basic-example-usage-with-nailing) * [Documentation table of contents](#documentation-table-of-contents) * [Out-of-tree builds](#out-of-tree-builds) * [How nailing-cargo helps with out-of-tree builds](#how-nailing-cargo-helps-with-out-of-tree-builds) * [Configuring out-of-tree builds](#configuring-out-of-tree-builds) * [Using local crates, or locally modified crates](#using-local-crates-or-locally-modified-crates) * [How nailing-cargo helps with using local crates](#how-nailing-cargo-helps-with-using-local-crates) * [Telling nailing-cargo how to massage `Cargo.toml`](#telling-nailing-cargo-how-to-massage-cargo.toml) * [Scope of nailing-cargo's local crate functionality](#scope-of-nailing-cargos-local-crate-functionality) * [Target architecture convenience aliases](#target-architecture-convenience-aliases) * [Default change to offline mode](#default-change-to-offline-mode) * [Invocation and command-line option reference](#invocation-and-command-line-option-reference) * [Usages](#usages) * [Options](#options) * [Environment of the build command](#environment-of-the-build-command) * [Configuration reference](#configuration-reference) * [Source directories and packages (toplevel)](#source-directories-and-packages-toplevel) * [`[alt_cargolock]`: Alternative `Cargo.lock` filename](#alt_cargolock-alternative-cargo.lock-filename) * [`[oot]`: Out-of-tree build support](#oot-out-of-tree-build-support) * [`[arch]`: Architecture convenience aliases](#arch-architecture-convenience-aliases) * [`[misc]`: Miscellaneous individual nailing-cargo config](#misc-miscellaneous-individual-nailing-cargo-config) * [Limitations and bugs](#limitations-and-bugs) * [Contributing and legal](#contributing-and-legal) * [Legal](#legal) Out-of-tree builds ================== It is often desirable to run builds in a way that does not write to the source tree. cargo's enthusiastic approach to the dependency management task means that it is a good idea to try to insulate your main working environment from the many things cargo has decided to download and execute. However, when you tell cargo to do an out of tree build (using `--manifest-path`) it will insist on `Cargo.lock` being in the source directory, and often will insist on writing to it. How nailing-cargo helps with out-of-tree builds ----------------------------------------------- nailing-cargo (configured appropriately) copies files back and forth to between the source and build directories, and runs cargo as your build user. The `Cargo.lock` must still be saved in your source tree somewhere. nailing-cargo arranges this for you. You can either put this file in `.gitignore`; or commit it to git; or you can tell nailing-cargo to save it as something like `Cargo.lock.example`. Depending on the circumstances, nailing-cargo uses a variety of strategies, including `--manifest-path` options, and linkfarming, to make out of tree builds. Some crates don't natively support out-of-tree builds, in which case passing a `--linkfarm` option to nailing-cargo can be helpful. Configuring out-of-tree builds ------------------------------ To enable out-of-tree-builds, put an `[oot]` section in your `Cargo.nail` or one of nailing-cargo's other config files. In that section, specify at least `use`. Also, specify `dir`, or create a symlink `Build` next to `Cargo.nail`, pointing to to your build area. For example, ``` [oot] use='ssh' user='rustcargo' ``` will have nailing-cargo run `ssh rustcargo@localhost` to run build commands. Using local crates, or locally modified crates ============================================== cargo does not work well with local crates, especially completely unpublished ones. (See [issue#6713](https://github.com/rust-lang/cargo/issues/6713), [stackoverflow](https://stackoverflow.com/questions/33025887/how-to-use-a-local-unpublished-crate), [issue#1481](https://github.com/rust-lang/cargo/issues/1481), [my blog](https://diziet.dreamwidth.org/1805.html).) Using a local version of a crate should be possible without putting paths into your `Cargo.toml` and without editing complex configuration. How nailing-cargo helps with using local crates ----------------------------------------------- nailing-cargo temporarily edits all the `Cargo.toml` files in all the subdirectories you mention, to refer to each other; then it runs cargo; and then it puts everything back. Telling nailing-cargo how to massage `Cargo.toml` ------------------------------------------------- To find the subdirectories, and the packages, nailing-cargo looks for `subdirs` and `packages` in `Cargo.nail`. For straightforward use, write `subdirs` as a multi-line string containing a list of subdirectory names one per line. In each of these directories `Cargo.toml` will be massaged, and the package there will be used for other massaged `Cargo.toml`s. See the [Configuration reference](#configuration-reference) for full details. Scope of nailing-cargo's local crate functionality -------------------------------------------------- nailing-cargo's `Cargo.toml` massaging will allow you to easily build an interdepending set of local packages, possibly even including private unpublished packages, and/or locally-modified versions of published packages. These local packages can freely depend on published packages (eg from `crates.io`) in the usual way. Compared to the corresponding cargo feature, nailing-cargo's approach: (i) works even for local crates that have not been published anywhere; and (ii) is a lot simpler to configure. But nailing-cargo's local crate support won't work if any non-local crate needs to be rebuilt against a local crate (ie, a local version of one of its dependencies). If that is your requirement, either make local versions of the intermediate crates in the dependency graph, or use the cargo override facility --- see [Overriding Dependencies](https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html) in the Cargo Book. Target architecture convenience aliases ======================================= If you are cross-building you may need to tell cargo `--target=`. The architecture names are quite long and inconvenient. A simple shell alias would help a lot, except that cargo rejects `--target=` when it thinks it's not needed. In your nailing-cargo config, you can write something like `arch.RPI='arm-unknown-linux-gnueabihf'`. Then `nailing-cargo -TRPI` will DTRT. In fact, you do not even need to specify that particular arch alias, since it is built-in to nailing-cargo. Default change to offline mode ============================== It seems to me that build tools should be explicit about their use of the network. So by default, nailing-cargo passes `--offline` to cargo. If you disagree with my opinion, write `misc.online=true` in your nailing-cargo configuration. `misc.online=false`, and command line options, are also available, for overriding. If you agree with me, you may wish to use `nailing-cargo generate-lockfile`, which can update (even an existing) `Cargo.lock` without going online, instead of `update`. Invocation and command-line option reference ============================================ Usages ------ ``` 1$ nailing-cargo [--] ... 2$ nailing-cargo --- [--] ... 3$ nailing-cargo --- [--] ... ``` Ususally the `--` is not needed. (It should generally be passed by programs which wrap nailing-cargo. See [Invocation argument disambiguation rules](#invocation-argument-disambiguation-rules), below.) In usage 1, nailing-cargo runs `cargo` (from `PATH`). In the usage 2 nailing-cargo runs ``. In both these cases it adds its own options to control cargo's behaviour. In both of these cases nailing-cargo looks at `` to determine the cargo subcommand being run: this controls various defaults, to try to do the right things. In the third syntax, nailing-cargo runs `...` without additional arguments and does not attempt to identify the cargo subcommand(s) that it will run. Possibly it will be necessary to pass `--online` or `--cargo-lock-update`, or even `--cargo-*arg*` ### Invocation argument disambiguation rules ### For authors of tools which call nailing-cargo (and pedants): The usages overlap in syntax! nailing-cargo follows the following rules when interpreting its command line: * The first option not recognised as a nailing-cargo option is treated as the start of the ``. * `` are terminated by `--` (which is removed) or the first argument which does not start with a `-` or `+`. (It is not possible to get nailing-cargo to pass the value `--` as a separate argument to a cargo global option, but cargo global options can typically take the values cuddled with `=`, so doing that is not necessary.) * After `---`, nailing-cargo will search for a `--`, to the end of the arguments if necessary. The position of the `--` determines whether this is usage 2 or usage 3, and what `` is. If the arguments after `nailing-cargo ... ---` might contain `--` anywhere, an explicit `--` should be passed. * If no `--` appears after `---`, the word after `---` is the command to run; if its final pathname component contains the string `cargo`, it is treated as `` (implying usage 2 and the search for ``). Otherwise it is treated as `` (usage 3). Options ------- * `-v`: Increase verbosity. Default is 1. * `-q`: Set verbosity to 0. * `-D`: Increase amount of debugging dump. * `-n`: "No action": stop after writing `Cargo.toml.nailing~` everywhere, and do not run any build command. * `-f` | `--force`: Force going ahead even if problems are likely. (E.g., due to missing `-E` option.) * `-T` | `--target=` Specify target architecture. This option translates to a `--target=` option to cargo (when the subcommand accepts it). If `` starts with a capital ascii letter, it is an alias for some other arch: it is looked up in the configuration, and then in the builtin arch alias list. The builtin list is equivalent to: ``` [arch] RPI="arm-unknown-linux-gnueabihf" WASM="wasm32-unknown-unknown" ``` * `-o` | `--online` | `-O` | `--offline` Whether to allow cargo to make network access. nailing-cargo always passes `--offline` to cargo, unless `--online` is in force. The default value depends on the configuration and the cargo subcommand - see [`[misc]` `online`](#misc_online), under Configuration. * `-u` | `--cargo-lock-update` | `-U` | `--no-cargo-lock-update` Allows (or disallows) cargo to update `Cargo.lock` in the source directory. Without this enabled, nailing-cargo passes `--locked` to cargo. With this enabled, in an out-of-tree build the `Cargo.lock` and `Cargo.toml` are copied to the build directory along with a linkfarm, to fool cargo. After cargo has run, the resulting `Cargo.lock` is copied back to the source tree. Default is no update unless the whole point of the cargo subcommand is to update `Cargo.lock`. * `-c` | `-C` Controls the addition of cargo command line options; ie, whether nailing-cargo should treat the build command as if it were cargo. With `-C`, nailing-cargo will not add additional options to the build command. With `-c` it will pass those options after the cargo subcommand (usages 1 and 2) or right after the build command (usage 3). The cargo options are in any case also passed in the environment - see [Environment of the build command](#environment-of-the-build-command). The default is to pass cargo options if the command line parsing yielded a cargo command and options (usages 1 and 2), rather than a non-cargo build command (usage 3). `-C` and `-c` do not affect the parsing of nailing-cargo's command line. * `-s` Behave as if the build command were `cargo `. This influences the logic which tries to determine which options to pass to cargo, whether cargo needs to be online, and whether cargo might want to update `Cargo.lock`. nailing-cargo knows about the following commands: * `fetch` * `fmt` * `generate-lockfile` * `init` * `metadatay` * `miri` * `publish` * `update` * `upgrades` All other subcommands are (silently) treated the same way as `build` (ie, no subcommand properties). See `--subcommand-props` for more detail about how the subcommand affects nailing-cargo's behaviour. The default is to use the cargo subcommand found from parsing nailing-cargo's command line. NB: `-s` does not affect which build command (and which cargo subcommand) is actually run. * `--subcommand-props=,...` Specify the properties of the subcommand. This is an alternative to `-s`. The usual properties are: * `lock-update`: cargo will want to update `Cargo.lock`. (The `-u` and `-U` options override this.) * `online`: this subcommand makes no sense to run offline. (The `-o` and `-O` options, and the configuration, can override this.) * `edits`: The purpose of this subcommand is to edit the source tree. Imples that `--edit-sources` is necessary (unless `--force`). * `creates`: The purpose of this subcommand is to edit the source tree and create new files in it. Imples that `-EE` (`--edit-sources`, twice) is necessary (unless `--force`). * `!target`: cargo would reject `--target=`; in this case nailing-cargo's `-T` option is ineffective. * `!target-dir`: cargo would reject `--target-dir`, so don't pass it. (Usually we pass `--target-dir=target` when we pass `--manifest-path`, since cargo's default is `target` in the same directory as `Cargo.toml`.) * `linkfarm-shallow`: Make the default be `--linkfarm=shallow`. This is the default for `miri` and can also be used for other subcommands which do not understandg `--manifest-path` properly. * `linkfarm-gitclean`: Make the defaults be `--linkfarm=git` and `--preclean-build=src`. * `pristine-git`: Turn on `--git` mode, and insist that the source tree be clean and clean the build tree before proceeding. This is the default for `publish`. There are also some properties which should not be needed, but are provided for completeness. Do not use these to solve the problem of nailing-cargo passing cargo options to a build command which is not cargo - use `-C` for that. The properties whose use is discouraged: * `!manifest-path`: cargo would reject `--manifest-path`, so don't pass it (and don't pass `--target-dir` either). Only makes any difference for out-of-tree builds. Things will probably go wrong unless the build command looks at `[NAILING]CARGO_MANIFEST_DIR`. * `!locked`: cargo would reject `--locked`, so don't pass it. Hazardous. * `!offline`: the build command would reject `--offline`, so never pass it. *Not* overridden by configuration or command line. * `--git|--no-git`: When git mode is enabled, and out-of-tree builds are being done, nailing-cargo will, instead of using `--manifest-path`, or linkfarming, use git operations to transfer the source code to the build directory. In git mode, the build directory should be a git working tree (and nailing-cargo will try to make it into one). If the source tree is dirty, nailing-cargo will generate a synthetic commit in the build tree, to contain the changes, so that the build tree is not dirty. The build tree will be left in a detached HEAD state. When precleaning is enabled, nailing-cargo will clean and `git reset --hard`. Without precleaning, a dirty tree may cause nailing-cargo to fail. Switching between git mode and non-git mode does not work well and is not recommended. * `--linkfarm[=no|shallow|git|full]`: Override nailing-cargo's approach to out-of-tree builds. Normally nailing-cargo chooses automatically whether to make a linkfarm, and precisely what kind of linkfarm, based on the cargo subcommand. The linkfarm styles are: * `no`: Do not make a linkfarm; pass a `--manifest-path` option pointing to the actual source directory. This is the default for most cargo commands. * `shallow`: Symlink top-level objects in the source directory, including whole subdirectories. This the default when nailing-cargo thinks cargo is going to update `Cargo.lock`. * `git`: Make a deep linkfarm, with subdirectories. Symlink those objects tracked by git. This is the default for `cargo publish`. This is *not* the same as `--git`: `--linkfarm=git` transfers the *files* tracked by git into the build environment, but *not* any actual git objects. * `full`: Make a deep linkfarm and symlink every nondirectory found in the source tree. This will including all sorts of junk, including for example editor backup files. Whenever nailing-cargo linkfarms, old symlinks pointing back to the source tree are deleted. In each case, `Cargo.lock` is not symlinked, but copied. If nailing-cargo expects cargo to update `Cargo.lock`, it will copy it back to the source tree afterwards. Just `--linkfarm` is the same as `--linkfarm=git`. * `--edit | --edit-sources | -E`: Permits the cargo command to edit sources in the source tree. This is achieved by *copying* the entire source tree (all files tracked by git) into the destination directory, and then copying back all changed files. *Only git tracked filles* can be edited by the cargo command; edits to other files, and creation of new files, will be ignored. When this option is repeated (`-EE`), the cargo subcommand can create new files including dotfiles (but nothing in the toplevel `target` and nothing called `.git`). (This also enables `--preclean=src` by default.) If you are running out of tree builds for privsep reasons, you should use git to review the edits made by the cargo command and either stage and commit them, or reject them. This option is overridden by a subsequent `--linkfarm` options. `-E` or `-f` is needed for `nailing-cargo fmt`. `-EE` or `-f` is needed for `nailing-cargo init`. `-E` is never the default, even if nailing-cargo thinks it's needed. * `--just-linkfarm[=shallow|git|full]`: Make the out-of-tree linkfarm as if for `--cargo-lock-update`, but do not actually run any command, nor try to copy back a a generated `Cargo.lock`. Forces `--keep-linkfarm` (even if the contrary is also specified). With a linkfarming mode, overrides (and is overridden by) `--linkfarm=`. Without a linkfarming mode, and without `--linkfarm`, the default is `shallow`. * `--keep-linkfarm` | `--clean-linkfarm`: When doing an out-of-tree lockfile update, controls whether the linkfarm is kept afterwards. Overrides the `oot.clean` config option. (Default: keep.) * `--[no-]preclean-build[=no|src|full]`: When doing an out-of-tree build, controls whether the build directory is purged of leftover contents *before* the build is run. The usual default is `no`. For `cargo publish`, the default is `src`, which deletes everything except the directory `target`. `full` means to clean out that too. * `--leave-nailed`: At the end, leave all the `Cargo.toml` files in their edited state, rather than (trying to) clean them up. To clean this up later, run `nailing-cargo` again without this option. Without this option, the nailed versions are left in `.Cargo.toml.nailed~`, so you only need this if you want to run cargo by hand or something. * `--subdir=`: operate in the relative subdirectory ``. This not ony changes directory before running the command, but also adjusts the various environment variables to which point to parts of the source and build trees. * `--chdir=`: change directory just before invoking cargo. If `` is relative, it is relative to the build tree. This is useful for `cargo publish`, which unfortunately does not support `-p` or `-workspace`. Just `--chdir=` cancels. * `--just-run`: Execute the specified command (perhaps concurrently with other commands), but do not manipulate any of Cargo's metadata fiules. Useful in out of tree mode to invoke a non-cargo command in the build environment. Implies `--no-nail`, `--no-cargo-lock-manip` and `--no-concurrency-lock` (overrideable by later occurrences of the corresponding opposite options). Hazardous if the command is actually cargo, or will run cargo. * `--no-nail` | `--nail` (default): Whether to actually nail - ie, whether to actually modify any `Cargo.toml`s while running the command. This can be useful, e.g., in out-of-tree mode with commands that don't actually invoke cargo. Consider passing `--no-concurrency-lock` too. Regardless of this option, no nailing is actually done unless `../Cargo.nail` exists and has some entries in its `subdirs` or `packages`. * `--no-cargo-lock-manip` | `--cargo-lock-manip` (default): Whether to manipulate `Cargo.lock`. For example, whether to copy it to the build tree and back (in out of tree mode) and whether to rename it from an alternative lockfile name, and put it back. Overrides `-u` etc. * `--no-concurrency-lock` | `--concurrency-lock` (default): Whether to take the nailing-cargo lock. Some kind of protection against concurrent operation is necessary to prevent multiple instances of nailing-cargo trashing each others' work, and possibly mangling your `Cargo.toml`s, `Cargo.lock`, etc., so `--no-concurrency-lock` is dangerous unless you take other measures against concurrent execution. * `-h` | `--help`: Print usage summary. * `--doc` | `--man` | `--manual`: Format this manual into html using `pandoc` and display it with `w3m`. Environment of the build command -------------------------------- nailing-cargo passes these environment variables to the build command: * `CARGO_MANIFEST_DIR`: invocation `.` (invocation directory) * `NAILINGCARGO_MANIFEST_DIR`: same as `CARGO_MANIFEST_DIR` * `NAILINGCARGO_WORKSPHERE`: invocation `..` (parent) * `NAILINGCARGO_BUILD_DIR`: build directory (even if same as source) * `NAILINGCARGO_BUILDSPHERE`: parent of build dir (only set if out-of-tree) * `NAILINGCARGO_CARGO_OPTIONS`: additional options that nailing-cargo passed (or would pass) to cargo. Space-separated; does not include `--manifest-path`. * `NAILINGCARGO_TOOLCHAIN`: The toolchain (as `+TOOLCHAIN`) if one was specified via `misc.usual.toolchain`, or on the command line. All of these are absolute paths. ### Build commands which wrap cargo ### If you specify a build command which eventually runs cargo, you may wish to pass on to your cargo the options which nailing-cargo would have passed. This will definitely be necessary if you are using nailing-cargo's out-of-tree facility. In such a situation, do it like this: ``` cargo build --manifest-path="${CARGO_MANIFEST_DIR-.}"/Cargo.toml $NAILINGCARGO_CARGO_OPTIONS ``` If you need to run a cargo subcommand which doesn't understand some of nailing-cargo's options, currently, you must strip them out of `NAILINGCARGO_CARGO_OPTIONS` yourself - or pass some `-s` or `--subcmd-props` option to nailing-cargo (but that is a layering violation and may not work if one build command runs various different cargo runes). Configuration reference ======================= nailing-cargo reads these configuration files: ``` /etc/nailing-cargo/cfg.toml ~/.nailing-cargo.toml ./.nailing-cargo.toml ../Nailing-Cargo.toml ../Cargo.nail ``` Settings in later-mentioned files override ones in earlier-mentioned files. Source directories and packages (toplevel) ------------------------------------------ Note that unlike everything else, these keys (`packages` and `subdirs`) are read only from `Cargo.nail` (see "Limitations and bugs", below). These keys specify a combination of (i) a mapping from package name to source subdirectory (ii) a set of subdirectories whose `Cargo.toml` must be massaged. * `packages`: a map keyed by package name, giving the subdirectory for each one. This causes each mentioned subdirectory's `Cargo.toml` to be massaged, and records that subdirectory as the source for that package. (nailing-cargo will check that subdirectory actually contains the indicated package.) Each value can be just the subdirectory name (eg `[packages]` `mylibrary='mylibrary-test'`) or itself a map with the key `subdir` (eg `[packages.mylibrary]` `subdir='mylibrary-test'`). * `subdirs`: a list of subdirectory names to process. Each subdirectory's `Cargo.toml` will be massaged. Also, the subdirectory will be examined to see what package it contains; it will then be used as the source for that package, unless that package appears in an entry in `packages`, or an earlier entry in `subdirs`. This can be a list of strings (eg `subdirs = ['myproject','mylibrary']`). Or it can be single multi-line string containing one subdirectory name per line; in that case, `#`-comments are supported and tabs and spaces are ignored (see "Most basic example usage" above.) In each case the subdirectory should usually be a relative pathname; it is relative to the directory containing `Cargo.nail`. `[alt_cargolock]`: Alternative `Cargo.lock` filename ---------------------------------------------------- To control use of alternative `Cargo.lock` filename, use the section `[alt_cargolock]`. Settings here: * `file = `. * `file = true`: Equivalent to `file = "Cargo.lock.example"`. (This is the default.) * `file = false`: Disables this feature. * `force = false`: Uses the alternative filename only if it already exists. (This is the default.) * `force = true`: Always uses the alternative filename. `[oot]`: Out-of-tree build support ---------------------------------- * `dir`: The build directory. If relative, it is relative to the parent of the invocation directory (and could be a symlink then). Default is `Build` (assuming `use` is specified). The build directory will contain one subdir for each package: each subdir in the build dir corresponds to one source dir where nailing-cargo was invoked. nailing-cargo will arrange to create these subdirectories, so the build directory can start out empty. * `use`: How to become the build user. Needs to be combined with other setting(s): * `ssh`: Use ssh. `user` must be given as well and can be a username on localhost, or the `@` argument to ssh. * `sudo`: Use sudo. `user` must be given as well. * `command_args`: `command` must be specified as a list, specifying a command and arguments which work like `nice`. * `command_sh`: `command` must be specified as a list, specifying a command and arguments which work like `sh -c`. * `null`: Run builds as the same user. * `really`: Use `really` from `chiark-really.deb`. `user` must be given as well. * `disable': Disable this feature, even if `dir` is set. * `command`: The command to run for `command_sh` or `command_args`. In both cases, this is a command and its arguments/options. The list will be passed to `execvp`. The difference between `command_args` and `command_sh` is in what nailing-cargo appends to the specified `command` list: For `command_args`, nailing cargo appends multiple more arguments; each one should be passed as-is as a single argument to the actual build command. This is correct if `command` is a program like `nice` or `really`, which takes a command and its arguments and does not go via the shell. For `command_sh`, nailing-cargo appends one single further argument. That argument is a shell command; nailing-cargo constructs it by shell-quoting the real command and arguments and wrapping them up in a small script, the text of which becomes the extra argument to `command`. This is correct if `command` will pass its argument to a bournelike shell - for example, if `command` is an ssh rune for a remote account whose shell is `/bin/sh` or `/bin/bash`. * `user`: The build username, for `really`, `sudo` and `ssh`. For `ssh`, can be just the local username (meaning `@localhost`), or `@`. * `clean` (boolean): When doing a `Cargo.lock` update, which involves linkfarming in the build directory, whether the clean up the linkfarm afterwards. Default: `true`. Can be overridden by `--keep-linkfarm` or `--clean-linkfarm`. `[arch]`: Architecture convenience aliases ------------------------------------------ This is a map from archictecture aliases to full cargo architecture names. The keys are the aliases; each entry should be a string, the cargo architecture name. Only keys starting with an ascii uppercase letter are relevant, since other names are not looked up in this alias map. `[misc]`: Miscellaneous individual nailing-cargo config ------------------------------------------------------- * `usual_toolchain`: Specifies a default `+` option to pass to `cargo`. This is used only in the first usage pattern, where `` is followed immediately by ``, and only if `` doesn't start with a `+...` argument. * `online`: Specifies whether to allow or prevent cargo from accessing the network. Value is a boolean or `'auto'`. `'auto'` permits online access if the cargo subcommand being invoked is one whose main purpose involves online access. Implemented by passing `--offline` to cargo when necessary --- cargo's default is online. nailing-cargo's default is `'auto'`. Limitations and bugs ==================== * nailing-cargo temporarily dirties your source trees, including particularly `Cargo.toml` and `Cargo.lock`; and if nailing-cargo crashes or is interrupted these changes may be left behind. Unfortunately it is not possible to avoid this temporary dirtying because the cargo team have deliberately made cargo inflexible - [issue#6715](https://github.com/rust-lang/cargo/issues/6715). At least, running nailing-cargo again will clean up any mess left by an interrupted run. * nailing-cargo needs to understand the behaviour of the cargo subcommand you are running - especially for out-of-tree builds. nailing-cargo only has a short builtin list of commands it knows about (see [`-s. Individual files generally contain the following tag in the copyright notice, instead of the full licence grant text: ``` SPDX-License-Identifier: AGPL-3.0-or-later ``` As is conventional, this should be read as a licence grant. work/TOML-Tiny/0000775000000000000000000000000014777226410010436 5ustar work/TOML-Tiny/.appveyor.yml0000664000000000000000000000063614777226410013111 0ustar skip_tags: true build: off cache: - C:\strawberry platform: - x86 - x64 install: - if not exist "C:\strawberry" cinst strawberryperl - set PATH=C:\strawberry\perl\bin;C:\strawberry\perl\site\bin;C:\strawberry\c\bin;%PATH% - cd C:\projects\%APPVEYOR_PROJECT_NAME% - cpanm -n Dist::Zilla - dzil authordeps --missing | cpanm -nq - dzil listdeps --missing | cpanm -nq test_script: - dzil test work/TOML-Tiny/.github/0000775000000000000000000000000014777226410011776 5ustar work/TOML-Tiny/.github/workflows/0000775000000000000000000000000014777226410014033 5ustar work/TOML-Tiny/.github/workflows/dzil-test.yml0000664000000000000000000000177514777226410016507 0ustar name: run-tests on: push: branches: - '*' tags-ignore: - '*' pull_request: jobs: dzil-test: env: # some plugins still needs this to run their tests... PERL_USE_UNSAFE_INC: 0 AUTHOR_TESTING: 1 AUTOMATED_TESTING: 1 RELEASE_TESTING: 1 PERL_ANYEVENT_MODEL: Perl runs-on: ubuntu-latest strategy: fail-fast: false matrix: perl-version: - 'latest' - '5.40' - '5.38' - '5.36' - '5.34' - '5.32' - '5.30' - '5.28' - '5.26' - '5.24' - '5.22' - '5.20' - '5.18' container: image: perldocker/perl-tester:${{ matrix.perl-version }} steps: - uses: actions/checkout@v3 - name: perl -V run: perl -V - name: Install Dependencies run: cpm install -g --no-test --show-build-log-on-failure --cpanfile cpanfile - name: Run tests run: prove -lmfr -j4 t work/TOML-Tiny/.gitignore0000664000000000000000000000005414777226410012425 0ustar .build scratch.pl TOML-Tiny-* nytprof* tags work/TOML-Tiny/Changes0000664000000000000000000001043614777226410011735 0ustar {{$NEXT}} 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 work/TOML-Tiny/Dockerfile0000664000000000000000000000030414777226410012425 0ustar 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 work/TOML-Tiny/MANIFEST.SKIP0000664000000000000000000000003214777226410012327 0ustar scratch.pl build-tests.pl work/TOML-Tiny/README.pod0000664000000000000000000002115414777226410012102 0ustar =pod =encoding UTF-8 =head1 NAME TOML::Tiny - a minimal, pure perl TOML parser and serializer =head1 VERSION version 0.20 =head1 SYNOPSIS use TOML::Tiny qw(from_toml to_toml); binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; # Decoding TOML my $toml = do{ local $/; }; my ($parsed, $error) = from_toml $toml; # Encoding TOML say to_toml({ stuff => { about => ['other', 'stuff'], }, }); # Object API my $parser = TOML::Tiny->new; my $data = $parser->decode($toml); say $parser->encode($data); =head1 DESCRIPTION =for html

Build status

C implements a pure-perl parser and generator for the L data format. It conforms to TOML v1.0 (with a few caveats; see L). C strives to maintain an interface compatible to the L and L modules, and could even be used to override C<$TOML::Parser>: use TOML; use TOML::Tiny; local $TOML::Parser = TOML::Tiny->new(...); say to_toml(...); =head1 EXPORTS C exports the following to functions for compatibility with the L module. See L. =head2 from_toml Parses a string of C-formatted source and returns the resulting data structure. Any arguments after the first are passed to L's constructor. If there is a syntax error in the C source, C will die with an explanation which includes the line number of the error. my $result = eval{ from_toml($toml_string) }; Alternately, this routine may be called in list context, in which case syntax errors will result in returning two values, C and an error message. my ($result, $error) = from_toml($toml_string); Additional arguments may be passed after the toml source string; see L. =head3 GOTCHAS =over =item Big integers and floats C supports integers and floats larger than what many perls support. When C encounters a value it may not be able to represent as a number, it will instead return a L or L. This behavior can be overridden by providing inflation routines: my $toml = TOML::Tiny->new( inflate_float => sub{ return do_something_else_with_floats( $_[0] ); }; ); =back =head2 to_toml Encodes a hash ref as a C-formatted string. my $toml = to_toml({foo => {'bar' => 'bat'}}); # [foo] # bar="bat" =head3 mapping perl to TOML types =head4 table =over =item C ref =back =head4 array =over =item C ref =back =head4 boolean =over =item C<\0> or C<\1> =item L =item L =back =head4 numeric types These are tricky in perl. When encountering a C, that representation is used. If the value is a defined (non-ref) scalar with the C or C flags set, the value will be emitted unchanged. This is in line with most other packages, so the normal hinting hacks for typed output apply: number => 0 + $number, string => "" . $string, =over =item L =item L =item numerical scalars =back =head4 datetime =over =item RFC3339-formatted string e.g., C<"1985-04-12T23:20:50.52Z"> =item L Ls are formatted as C, as expected by C. However, C supports the concept of a "local" time zone, which strays from C by allowing a datetime without a time zone offset. This is represented in perl by a C with a B. =back =head4 string All other non-ref scalars are treated as strings. =head1 OBJECT API =head2 new =over =item inflate_datetime By default, C treats TOML datetimes as strings in the generated data structure. The C parameter allows the caller to provide a routine to intercept those as they are generated: use DateTime::Format::RFC3339; my $parser = TOML::Tiny->new( inflate_datetime => sub{ my ($dt_string) = @_; # DateTime::Format::RFC3339 will set the resulting DateTime's formatter # to itself. Fallback is the DateTime default, ISO8601, with a possibly # floating time zone. return eval{ DateTime::Format::RFC3339->parse_datetime($dt_string) } || DateTime::Format::ISO8601->parse_datetime($dt_string); }, ); =item inflate_boolean By default, boolean values in a C document result in a C<1> or C<0>. If L is installed, they will instead be C or C. If you wish to override this, you can provide your own routine to generate values: my $parser = TOML::Tiny->new( inflate_boolean => sub{ my $bool = shift; if ($bool eq 'true') { return 'The Truth'; } else { return 'A Lie'; } }, ); =item inflate_integer TOML integers are 64 bit and may not match the size of the compiled perl's internal integer type. By default, C coerces numbers that fit within a perl number by adding C<0>. For bignums, a L is returned. This may be overridden by providing an inflation routine: my $parser = TOML::Tiny->new( inflate_integer => sub{ my $parsed = shift; return sprintf 'the number "%d"', $parsed; }; ); =item inflate_float TOML floats are 64 bit and may not match the size of the compiled perl's internal float type. As with integers, floats are coerced to numbers and large floats are upgraded to Ls. The special strings C and C may also be returned. You can override this by specifying an inflation routine. my $parser = TOML::Tiny->new( inflate_float => sub{ my $parsed = shift; return sprintf '"%0.8f" is a float', $parsed; }; ); =item strict C imposes some miscellaneous strictures on C input, such as disallowing trailing commas in inline tables and failing on invalid UTF8 input. B C was previously called C. Both are accepted for backward compatibility, although enforcement of homogenous arrays is no longer supported as it has been dropped from the spec. =back =head2 decode Decodes C and returns a hash ref. Dies on parse error. =head2 encode Encodes a perl hash ref as a C-formatted string. =head2 parse Alias for C to provide compatibility with C when overriding the parser by setting C<$TOML::Parser>. =head1 DIFFERENCES FROM L AND L C differs in a few significant ways from the L module, particularly in adding support for newer C features and strictness. L defaults to lax parsing and provides C to (slightly) tighten things up. C defaults to (somewhat) stricter parsing, enabling some extra strictures with L. C supports a number of options which do not exist in L: L, L, and L. C ignores invalid surrogate pairs within basic and multiline strings (L may attempt to decode an invalid pair). Additionally, only those character escapes officially supported by TOML are interpreted as such by C. C supports stripping initial whitespace and handles lines terminating with a backslash correctly in multilne strings: # TOML input x=""" foo""" y="""\ how now \ brown \ bureaucrat.\ """ # Perl output {x => 'foo', y => 'how now brown bureaucrat.'} C includes support for integers specified in binary, octal or hex as well as the special float values C and C. =head1 SEE ALSO =over =item L Regexp scraps used by C to parse TOML source. =back =head1 ACKNOWLEDGEMENTS Thanks to L for encouraging their employees to contribute back to the open source ecosystem. Without their dedication to quality software development this distribution would not exist. A big thank you to those who have contributed code or bug reports: =over =item L =item L =item L =item L =back =head1 AUTHOR Jeff Ober =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2025 by Jeff Ober. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut work/TOML-Tiny/build-tests.pl0000664000000000000000000002024014777226410013230 0ustar #------------------------------------------------------------------------------- # Generates perl unit tests from the toml/json files in BurntSush/toml-test # without having to add special casing to TOML::Tiny to conform to their # annotated JSON format. #------------------------------------------------------------------------------- use strict; use warnings; no warnings 'experimental'; use v5.18; use Data::Dumper; use JSON::PP; use File::Copy; use File::Find; use File::Spec; # We want to read unicde as characters from toml-test source files. That makes # things simpler for us when we parse them and generate perl source in the # generated test file. binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; sub slurp{ open my $fh, '<', $_[0] or die $!; local $/; <$fh>; } # Removes type annotations from BurntSushi/toml-test JSON files and returns the # cleaned up data structure to which the associated TOML file should be parsed. sub deturd_json{ state $json = JSON::PP->new->utf8(1); my $annotated = $json->decode(slurp(shift)); my $cleanish = deannotate($annotated); local $Data::Dumper::Varname = 'expected'; local $Data::Dumper::Deparse = 1; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; return Dumper($cleanish); } # Recursively deannotates and inflates values from toml-test JSON data # structures into a format more in line with TOML::Tiny's parser outout. For # integer and float values, a Test2::Tools::Compare validator is generated to # compare using Math::Big(Int|Float)->beq, since TOML's float and int types are # 64 bits. Datetimes are converted to a common, normalized string format. sub deannotate{ my $data = shift; for (ref $data) { when ('HASH') { if (exists $data->{type} && exists $data->{value} && keys(%$data) == 2) { for ($data->{type}) { return $data->{value} eq 'true' ? 1 : 0 when /bool/; return [ map{ deannotate($_) } @{$data->{value}} ] when /array/; when (/integer/) { my $src = qq{ use Test2::Tools::Compare qw(validator); validator('Math::BigInt->new("$data->{value}")->beq(\$_)' => sub{ require Math::BigInt; my \$got = Math::BigInt->new(\$_); Math::BigInt->new("$data->{value}")->beq(\$got); }); }; my $result = eval $src; $@ && die $@; return $result; } when (/float/) { my $src; if ($data->{value} eq 'nan') { $src = qq{ use Test2::Tools::Compare qw(validator); validator('Math::BigFloat->new(\$_)->is_nan' => sub{ require Math::BigFloat; Math::BigFloat->new(\$_)->is_nan; }); }; } elsif ($data->{value} eq 'inf') { $src = qq{ use Test2::Tools::Compare qw(validator); validator('Math::BigFloat->new(\$_)->is_inf' => sub{ require Math::BigFloat; Math::BigFloat->new(\$_)->is_inf; }); }; } elsif ($data->{value} eq '-inf') { $src = qq{ use Test2::Tools::Compare qw(validator); validator('Math::BigFloat->new(\$_)->is_inf' => sub{ require Math::BigFloat; Math::BigFloat->new(\$_)->is_inf; }); }; } else { $src = qq{ use Test2::Tools::Compare qw(validator); validator('Math::BigFloat->new("$data->{value}")->beq(\$_)' => sub{ require Math::BigFloat; my \$got = Math::BigFloat->new(\$_); Math::BigFloat->new("$data->{value}")->beq(\$got); }); }; } my $result = eval $src; $@ && die $@; return $result; } default{ return $data->{value} } } } my %object; $object{$_} = deannotate($data->{$_}) for keys %$data; return \%object; } when ('ARRAY') { return [ map{ deannotate($_) } @$data ]; } default{ return $data; } } } sub find_tests{ my $src = shift; my %tests; find { no_chdir => 1, wanted => sub { return unless /\.toml$/; my $abs = File::Spec->rel2abs( $_ ); my $rel = File::Spec->abs2rel( $abs, $src ); my $toml = $rel; my $test = substr $rel, 0, -5; $tests{$test} = $toml; }, } => $src; return %tests; } sub build_pospath_test_files{ my $src = shift; my $dest = shift; $src = "$src/tests/valid"; $dest = "$dest/t/toml-test/valid"; print "Generating positive path tests from $src\n"; my %TOML = find_tests( $src ); for (sort keys %TOML) { copy("$src/$TOML{$_}", "$dest/$TOML{$_}"); my $json = substr( $TOML{$_}, 0, -4 ) . 'json'; my $data = deturd_json("$src/$json"); my $test = "$dest/$_.t"; my ( undef, $path ) = File::Spec->splitpath( $test ); unless (-f $test) { system('mkdir', '-p', $path) == 0 || die $?; } open my $fh, '>', $test or die $!; print $fh qq{# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local \$Data::Dumper::Sortkeys = 1; local \$Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my \$fh, '<', "$dest/$TOML{$_}" or die \$!; binmode \$fh, ':encoding(UTF-8)'; my \$toml = do{ local \$/; <\$fh>; }; close \$fh; my $data my \$actual = from_toml(\$toml); is(\$actual, \$expected1, '$_ - from_toml') or do{ diag 'TOML INPUT:'; diag "\$toml"; diag ''; diag 'EXPECTED:'; diag Dumper(\$expected1); diag ''; diag 'ACTUAL:'; diag Dumper(\$actual); }; my \$regenerated = to_toml \$actual; my \$reparsed = eval{ scalar from_toml \$regenerated }; my \$error = \$@; ok(!\$error, '$_ - to_toml - no errors') or diag \$error; is(\$reparsed, \$expected1, '$_ - to_toml') or do{ diag "ERROR: \$error" if \$error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper(\$actual); diag ''; diag 'REGENERATED TOML:'; diag \$regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper(\$reparsed); }; done_testing;}; close $fh; } } sub build_negpath_test_files{ my $src = shift; my $dest = shift; $src = "$src/tests/invalid"; $dest = "$dest/t/toml-test/invalid"; print "Generating negative path tests from $src\n"; my %TOML = find_tests( $src ); for (sort keys %TOML) { copy("$src/$TOML{$_}", "$dest/$TOML{$_}"); my $test = "$dest/$_.t"; my ( undef, $path ) = File::Spec->splitpath( $test ); unless (-f $test) { system('mkdir', '-p', $path) == 0 || die $?; } open my $fh, '>', $test or die $!; print $fh qq{# File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use TOML::Tiny; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my \$fh, '<', "$dest/$TOML{$_}" or die \$!; binmode \$fh, ':raw'; my \$toml = do{ local \$/; <\$fh>; }; close \$fh; ok dies(sub{ scalar from_toml(\$toml, strict => 1) }), 'strict_mode dies on $_'; done_testing;}; close $fh; } } my $usage = "usage: build-tests \$toml-test-repo-path \$toml-tiny-repo-path\n"; my $toml_test_path = shift @ARGV || die $usage; my $toml_tiny_path = shift @ARGV || die $usage; -d $toml_test_path || die "invalid path to BurntSushi/toml-test: $toml_test_path\n"; -d "$toml_test_path/tests" || die "invalid path to BurntSushi/toml-test: $toml_test_path\n"; -d $toml_tiny_path || die "invalid path to TOML::Tiny repo: $toml_tiny_path\n"; -d "$toml_tiny_path/t" || die "invalid path to TOML::Tiny repo: $toml_tiny_path\n"; print "Checking out master branch of BurntSushi/toml-test and pulling the latest commits\n"; system("cd $toml_test_path && git checkout master && git pull") == 0 || die $!; build_pospath_test_files($toml_test_path, $toml_tiny_path); build_negpath_test_files($toml_test_path, $toml_tiny_path); work/TOML-Tiny/cpanfile0000664000000000000000000000112514777226410012141 0ustar requires 'perl' => '>= 5.018'; requires 'Carp' => '0'; requires 'Data::Dumper' => '0'; requires 'Exporter' => '0'; requires 'Encode' => '0'; requires 'Math::BigInt' => '>= 1.999718'; recommends 'Types::Serialiser' => 0; on test => sub{ requires 'Data::Dumper' => '0'; requires 'DateTime::Format::ISO8601' => '0'; requires 'TOML::Parser' => '0'; requires 'Test2::V0' => '0'; requires 'Test::Pod' => '0'; requires 'DateTime::Format::RFC3339' => '0'; recommends 'Unicode::GCString' => '0'; }; work/TOML-Tiny/dist.ini0000664000000000000000000000065114777226410012104 0ustar name = TOML-Tiny author = Jeff Ober license = Perl_5 copyright_holder = Jeff Ober [@Basic] [Git::Check] [Git::NextVersion] first_version = 0.01 [NextRelease] format = %v %{yyyy-MM-dd}d [ReadmeAnyFromPod / ReadmePodInRoot] type = pod [GithubMeta] issues = 1 [PkgVersion] [PodSyntaxTests] [Test::ReportPrereqs] [Prereqs::FromCPANfile] [MetaJSON] [Git::Commit] [Git::Tag] [Git::Push] [PodWeaver] work/TOML-Tiny/lib/0000775000000000000000000000000014777226410011204 5ustar work/TOML-Tiny/lib/TOML/0000775000000000000000000000000014777226410011757 5ustar work/TOML-Tiny/lib/TOML/Tiny/0000775000000000000000000000000014777226410012702 5ustar work/TOML-Tiny/lib/TOML/Tiny/Faithful.pm0000664000000000000000000000313614777226410015005 0ustar package TOML::Tiny::Faithful; use parent TOML::Tiny; use DateTime::Format::ISO8601; use DateTime::Format::RFC3339; use DateTime; use Types::Serialiser; # ensures that Parser DTRT with booleans our @EXPORT = qw( from_toml to_toml ); sub _options { inflate_datetime => sub { # RFC3339 bombs out if there is no timezone, so we parse with 8601 DateTime::Format::ISO8601->parse_datetime(shift) }, no_string_guessing => 1, } sub new { my ($class, %param) = @_; bless TOML::Tiny->new(_options(), %param), $class; } sub from_toml { my $source = shift; TOML::Tiny::from_toml($source, _options(), @_); } sub to_toml { my $source = shift; TOML::Tiny::to_toml($source, _options(), @_); } package TOML::Tiny::Faithful::DateTime::Formatter; use DateTime::Format::RFC3339; our $base = DateTime::Format::RFC3339->new(); sub new ($) { my ($class) = @_; bless { }, $class; } 1; =head1 SYNOPSIS use TOML::Tiny::Faithful 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::Faithful->new; my $data = $parser->decode($toml); say $parser->encode($data); =head1 DESCRIPTION C is a trivial wrapper around C which sets C and C to try to make the TOML output faithful to any input TOML. =head1 SEE ALSO =over =item L =back work/TOML-Tiny/lib/TOML/Tiny/Grammar.pm0000664000000000000000000001604514777226410014634 0ustar package TOML::Tiny::Grammar; # ABSTRACT: exports regex definitions used to parse TOML source 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; =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 =cut work/TOML-Tiny/lib/TOML/Tiny/Parser.pm0000664000000000000000000003030214777226410014472 0ustar package TOML::Tiny::Parser; # ABSTRACT: parser used by TOML::Tiny 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; work/TOML-Tiny/lib/TOML/Tiny/Tokenizer.pm0000664000000000000000000001320614777226410015214 0ustar package TOML::Tiny::Tokenizer; # ABSTRACT: tokenizer used by TOML::Tiny 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; work/TOML-Tiny/lib/TOML/Tiny/Util.pm0000664000000000000000000000213414777226410014155 0ustar package TOML::Tiny::Util; # ABSTRACT: utility functions used by TOML::Tiny 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; work/TOML-Tiny/lib/TOML/Tiny/Writer.pm0000664000000000000000000001552114777226410014520 0ustar package TOML::Tiny::Writer; 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; work/TOML-Tiny/lib/TOML/Tiny.pm0000664000000000000000000002431414777226410013244 0ustar package TOML::Tiny; # ABSTRACT: a minimal, pure perl TOML parser and serializer 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; =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 =begin html

Build status

=end 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 work/TOML-Tiny/perlimports.toml0000664000000000000000000000211214777226410013707 0ustar # 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 work/TOML-Tiny/t/0000775000000000000000000000000014777226410010701 5ustar work/TOML-Tiny/t/faithful.t0000664000000000000000000000232014777226410012665 0ustar 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 boolf=false boolt=true boolfs="false" boolts="true" dtlocal=1979-05-27T00:32:00.643144312 dtlocals="1979-05-27T00:32:00.643144312" }; sub norm ($) { join "\n", ( sort map { s{=0o(\d+)$}{ '='.oct($1) }e; s{=(0[xb]\w+)$}{ '='.eval($1) }e; $_; } grep /./, split /\n/, $_[0] ), '' } my $coder = TOML::Tiny->new( no_string_guessing => 1, inflate_datetime => sub { # RFC3339 bombs out if there is no timezone, so we parse with 8601 DateTime::Format::ISO8601->parse_datetime(shift) }, ); my $parsed = $coder->decode($input); my $actual = norm($coder->encode($parsed)); my $expected = norm($input); is($actual, $expected, 'round trip') or do{ diag 'EXPECTED:'; diag Dumper($expected); diag 'ACTUAL:'; diag Dumper($actual); }; done_testing; work/TOML-Tiny/t/numbers.t0000664000000000000000000001011714777226410012541 0ustar 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; work/TOML-Tiny/t/parity.t0000664000000000000000000000430614777226410012401 0ustar #------------------------------------------------------------------------------- # Tests the results of parsing the example TOML from # https://github.com/toml-lang/toml against the de facto standard TOML module # on CPAN. Includes the array-of-tables example as well since that is not # represented in the synopsis example #------------------------------------------------------------------------------- use Test2::V0; use Data::Dumper; use TOML::Tiny::Parser; my $toml = do{ local $/; }; subtest 'TOML::Parser' => sub{ use TOML::Parser; subtest 'defaults' => sub{ my $exp = TOML::Parser->new->parse($toml); my $got = TOML::Tiny::Parser->new->parse($toml); is $got, $exp, 'equivalence' or diag Dumper({got => $got, expected => $exp}); }; subtest 'inflate_boolean' => sub{ my $inflate = sub{ shift eq 'true' ? 'yes' : 'no' }; my $exp = TOML::Parser->new(inflate_boolean => $inflate)->parse($toml); my $got = TOML::Tiny::Parser->new(inflate_boolean => $inflate)->parse($toml); is $got, $exp, 'equivalence' or diag Dumper({got => $got, expected => $exp}); }; subtest 'inflate_datetime' => sub{ require DateTime::Format::RFC3339; my $inflate = sub{ DateTime::Format::RFC3339->parse_datetime(shift) }; my $exp = TOML::Parser->new(inflate_datetime => $inflate)->parse($toml); my $got = TOML::Tiny::Parser->new(inflate_datetime => $inflate)->parse($toml); is $got, $exp, 'equivalence' or diag Dumper({got => $got, expected => $exp}); }; }; done_testing; __DATA__ # This is a TOML document. title = "TOML Example" [owner] name = "Tom Preston-Werner" dob = 1979-05-27T07:32:00-08:00 # First class dates [database] server = "192.168.1.1" ports = [ 8001, 8001, 8002 ] connection_max = 5000 enabled = true options = {"quote-keys"=false} [servers] # Indentation (tabs and/or spaces) is allowed but not required [servers.alpha] ip = "10.0.0.1" dc = "eqdc10" [servers.beta] ip = "10.0.0.2" dc = "eqdc10" [clients] data = [ ["gamma", "delta"], [1, 2] ] # Line breaks are OK when inside arrays hosts = [ "alpha", "omega" ] [[products]] name = "Hammer" sku = 738594937 [[products]] [[products]] name = "Nail" sku = 284758393 color = "gray" work/TOML-Tiny/t/parser.t0000664000000000000000000000364014777226410012365 0ustar 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; work/TOML-Tiny/t/strict_arrays.t0000664000000000000000000000044414777226410013761 0ustar 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; work/TOML-Tiny/t/toml-test/0000775000000000000000000000000014777226410012631 5ustar work/TOML-Tiny/t/toml-test/invalid/0000775000000000000000000000000014777226410014257 5ustar work/TOML-Tiny/t/toml-test/invalid/array/0000775000000000000000000000000014777226410015375 5ustar work/TOML-Tiny/t/toml-test/invalid/array/missing-separator.t0000664000000000000000000000066514777226410021240 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/array/missing-separator.toml0000664000000000000000000000002214777226410021733 0ustar wrong = [ 1 2 3 ] work/TOML-Tiny/t/toml-test/invalid/array/no-close-2.t0000664000000000000000000000064714777226410017447 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/array/no-close-2.toml0000664000000000000000000000001214777226410020141 0ustar x = [42 # work/TOML-Tiny/t/toml-test/invalid/array/no-close-table-2.t0000664000000000000000000000066314777226410020532 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/array/no-close-table-2.toml0000664000000000000000000000002214777226410021227 0ustar x = [{ key = 42 # work/TOML-Tiny/t/toml-test/invalid/array/no-close-table.t0000664000000000000000000000065714777226410020376 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/array/no-close-table.toml0000664000000000000000000000002014777226410021066 0ustar x = [{ key = 42 work/TOML-Tiny/t/toml-test/invalid/array/no-close.t0000664000000000000000000000064314777226410017304 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/array/no-close.toml0000664000000000000000000000002714777226410020010 0ustar long_array = [ 1, 2, 3 work/TOML-Tiny/t/toml-test/invalid/array/tables-1.t0000664000000000000000000000064314777226410017175 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/array/tables-1.toml0000664000000000000000000000006714777226410017705 0ustar # INVALID TOML DOC fruit = [] [[fruit]] # Not allowed work/TOML-Tiny/t/toml-test/invalid/array/tables-2.t0000664000000000000000000000064314777226410017176 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/array/tables-2.toml0000664000000000000000000000027414777226410017706 0ustar # INVALID TOML DOC [[fruit]] name = "apple" [[fruit.variety]] name = "red delicious" # This table conflicts with the previous table [fruit.variety] name = "granny smith" work/TOML-Tiny/t/toml-test/invalid/array/text-after-array-entries.t0000664000000000000000000000070314777226410022430 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/array/text-after-array-entries.toml0000664000000000000000000000010614777226410023135 0ustar array = [ "Is there life after an array separator?", No "Entry" ] work/TOML-Tiny/t/toml-test/invalid/array/text-before-array-separator.t0000664000000000000000000000071114777226410023117 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/array/text-before-array-separator.toml0000664000000000000000000000010714777226410023626 0ustar array = [ "Is there life before an array separator?" No, "Entry" ] work/TOML-Tiny/t/toml-test/invalid/array/text-in-array.t0000664000000000000000000000065514777226410020274 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/array/text-in-array.toml0000664000000000000000000000007014777226410020773 0ustar array = [ "Entry 1", I don't belong, "Entry 2", ] work/TOML-Tiny/t/toml-test/invalid/bool/0000775000000000000000000000000014777226410015212 5ustar work/TOML-Tiny/t/toml-test/invalid/bool/mixed-case.t0000664000000000000000000000064514777226410017423 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/bool/mixed-case.toml0000664000000000000000000000001614777226410020123 0ustar valid = False work/TOML-Tiny/t/toml-test/invalid/bool/wrong-case-false.t0000664000000000000000000000066114777226410020537 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/bool/wrong-case-false.toml0000664000000000000000000000001214777226410021235 0ustar b = FALSE work/TOML-Tiny/t/toml-test/invalid/bool/wrong-case-true.t0000664000000000000000000000065714777226410020431 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/bool/wrong-case-true.toml0000664000000000000000000000001114777226410021121 0ustar a = TRUE work/TOML-Tiny/t/toml-test/invalid/control/0000775000000000000000000000000014777226410015737 5ustar work/TOML-Tiny/t/toml-test/invalid/control/comment-del.t0000664000000000000000000000065514777226410020336 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/comment-del.toml0000664000000000000000000000003114777226410021032 0ustar comment-del = "0x7f" #  work/TOML-Tiny/t/toml-test/invalid/control/comment-lf.t0000664000000000000000000000065314777226410020171 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/comment-lf.toml0000664000000000000000000000003214777226410020670 0ustar comment-lf = "ctrl-P" #  work/TOML-Tiny/t/toml-test/invalid/control/comment-null.t0000664000000000000000000000065714777226410020546 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/comment-null.toml0000664000000000000000000000003214777226410021241 0ustar comment-null = "null" # work/TOML-Tiny/t/toml-test/invalid/control/comment-us.t0000664000000000000000000000065314777226410020217 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/comment-us.toml0000664000000000000000000000003214777226410020716 0ustar comment-us = "ctrl-_" #  work/TOML-Tiny/t/toml-test/invalid/control/multi-del.t0000664000000000000000000000065114777226410020022 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/multi-del.toml0000664000000000000000000000003014777226410020521 0ustar multi-del = """null""" work/TOML-Tiny/t/toml-test/invalid/control/multi-lf.t0000664000000000000000000000064714777226410017664 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/multi-lf.toml0000664000000000000000000000002714777226410020364 0ustar multi-lf = """null""" work/TOML-Tiny/t/toml-test/invalid/control/multi-null.t0000664000000000000000000000065314777226410020232 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/multi-null.toml0000664000000000000000000000003114777226410020730 0ustar multi-null = """null""" work/TOML-Tiny/t/toml-test/invalid/control/multi-us.t0000664000000000000000000000064714777226410017712 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/multi-us.toml0000664000000000000000000000002714777226410020412 0ustar multi-us = """null""" work/TOML-Tiny/t/toml-test/invalid/control/rawmulti-del.t0000664000000000000000000000065714777226410020542 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/rawmulti-del.toml0000664000000000000000000000003314777226410021236 0ustar rawmulti-del = '''null''' work/TOML-Tiny/t/toml-test/invalid/control/rawmulti-lf.t0000664000000000000000000000065514777226410020375 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/rawmulti-lf.toml0000664000000000000000000000003214777226410021072 0ustar rawmulti-lf = '''null''' work/TOML-Tiny/t/toml-test/invalid/control/rawmulti-null.t0000664000000000000000000000066114777226410020743 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/rawmulti-null.toml0000664000000000000000000000003414777226410021445 0ustar rawmulti-null = '''null''' work/TOML-Tiny/t/toml-test/invalid/control/rawmulti-us.t0000664000000000000000000000065514777226410020423 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/rawmulti-us.toml0000664000000000000000000000003214777226410021120 0ustar rawmulti-us = '''null''' work/TOML-Tiny/t/toml-test/invalid/control/rawstring-del.t0000664000000000000000000000066114777226410020711 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/rawstring-del.toml0000664000000000000000000000003014777226410021407 0ustar rawstring-del = 'null' work/TOML-Tiny/t/toml-test/invalid/control/rawstring-lf.t0000664000000000000000000000065714777226410020553 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/rawstring-lf.toml0000664000000000000000000000002714777226410021252 0ustar rawstring-lf = 'null' work/TOML-Tiny/t/toml-test/invalid/control/rawstring-null.t0000664000000000000000000000066314777226410021121 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/rawstring-null.toml0000664000000000000000000000003114777226410021616 0ustar rawstring-null = 'null' work/TOML-Tiny/t/toml-test/invalid/control/rawstring-us.t0000664000000000000000000000065714777226410020601 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/rawstring-us.toml0000664000000000000000000000002714777226410021300 0ustar rawstring-us = 'null' work/TOML-Tiny/t/toml-test/invalid/control/string-bs.t0000664000000000000000000000065114777226410020036 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/string-bs.toml0000664000000000000000000000003114777226410020536 0ustar string-bs = "backspace" work/TOML-Tiny/t/toml-test/invalid/control/string-del.t0000664000000000000000000000065314777226410020200 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/string-del.toml0000664000000000000000000000002514777226410020701 0ustar string-del = "null" work/TOML-Tiny/t/toml-test/invalid/control/string-lf.t0000664000000000000000000000065114777226410020033 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/string-lf.toml0000664000000000000000000000002414777226410020535 0ustar string-lf = "null" work/TOML-Tiny/t/toml-test/invalid/control/string-null.t0000664000000000000000000000065514777226410020410 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/string-null.toml0000664000000000000000000000002614777226410021110 0ustar string-null = "null" work/TOML-Tiny/t/toml-test/invalid/control/string-us.t0000664000000000000000000000065114777226410020061 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/control/string-us.toml0000664000000000000000000000002414777226410020563 0ustar string-us = "null" work/TOML-Tiny/t/toml-test/invalid/datetime/0000775000000000000000000000000014777226410016053 5ustar work/TOML-Tiny/t/toml-test/invalid/datetime/impossible-date.t0000664000000000000000000000066714777226410021332 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/datetime/impossible-date.toml0000664000000000000000000000003114777226410022023 0ustar d = 2006-01-50T00:00:00Z work/TOML-Tiny/t/toml-test/invalid/datetime/no-leads-with-milli.t0000664000000000000000000000067714777226410022031 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/datetime/no-leads-with-milli.toml0000664000000000000000000000004414777226410022525 0ustar with-milli = 1987-07-5T17:45:00.12Z work/TOML-Tiny/t/toml-test/invalid/datetime/no-leads.t0000664000000000000000000000065114777226410017744 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/datetime/no-leads.toml0000664000000000000000000000003714777226410020452 0ustar no-leads = 1987-7-05T17:45:00Z work/TOML-Tiny/t/toml-test/invalid/datetime/no-secs.t0000664000000000000000000000064714777226410017616 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/datetime/no-secs.toml0000664000000000000000000000003414777226410020314 0ustar no-secs = 1987-07-05T17:45Z work/TOML-Tiny/t/toml-test/invalid/datetime/no-t.t0000664000000000000000000000064114777226410017116 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/datetime/no-t.toml0000664000000000000000000000003314777226410017621 0ustar no-t = 1987-07-0517:45:00Z work/TOML-Tiny/t/toml-test/invalid/datetime/trailing-t.t0000664000000000000000000000065514777226410020320 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/datetime/trailing-t.toml0000664000000000000000000000002014777226410021012 0ustar d = 2006-01-30T work/TOML-Tiny/t/toml-test/invalid/encoding/0000775000000000000000000000000014777226410016045 5ustar work/TOML-Tiny/t/toml-test/invalid/encoding/bad-utf8-at-end.t0000664000000000000000000000066714777226410021023 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/encoding/bad-utf8-at-end.toml0000664000000000000000000000036214777226410021523 0ustar # 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 = """"""Úwork/TOML-Tiny/t/toml-test/invalid/encoding/bad-utf8-in-comment.t0000664000000000000000000000067714777226410021722 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/encoding/bad-utf8-in-comment.toml0000664000000000000000000000000414777226410022412 0ustar # à work/TOML-Tiny/t/toml-test/invalid/encoding/bad-utf8-in-string.t0000664000000000000000000000067514777226410021564 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/encoding/bad-utf8-in-string.toml0000664000000000000000000000010314777226410022256 0ustar # The following line contains an invalid UTF-8 sequence. bad = "Ã" work/TOML-Tiny/t/toml-test/invalid/encoding/bom-not-at-start-1.t0000664000000000000000000000067514777226410021510 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/encoding/bom-not-at-start-1.toml0000664000000000000000000000002414777226410022204 0ustar bom-not-at-start ÿý work/TOML-Tiny/t/toml-test/invalid/encoding/bom-not-at-start-2.t0000664000000000000000000000067514777226410021511 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/encoding/bom-not-at-start-2.toml0000664000000000000000000000002514777226410022206 0ustar bom-not-at-start= ÿý work/TOML-Tiny/t/toml-test/invalid/encoding/utf16-bom.t0000664000000000000000000000065314777226410017756 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/encoding/utf16-bom.toml0000664000000000000000000000004614777226410020462 0ustar þÿ# UTF-16 with BOM work/TOML-Tiny/t/toml-test/invalid/encoding/utf16.t0000664000000000000000000000064314777226410017202 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/encoding/utf16.toml0000664000000000000000000000005214777226410017704 0ustar # UTF-16 without BOM work/TOML-Tiny/t/toml-test/invalid/float/0000775000000000000000000000000014777226410015364 5ustar work/TOML-Tiny/t/toml-test/invalid/float/double-point-1.t0000664000000000000000000000065714777226410020320 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/double-point-1.toml0000664000000000000000000000002614777226410021016 0ustar double-point-1 = 0..1 work/TOML-Tiny/t/toml-test/invalid/float/double-point-2.t0000664000000000000000000000065714777226410020321 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/double-point-2.toml0000664000000000000000000000002714777226410021020 0ustar double-point-2 = 0.1.2 work/TOML-Tiny/t/toml-test/invalid/float/exp-double-e-1.t0000664000000000000000000000065714777226410020205 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/exp-double-e-1.toml0000664000000000000000000000002614777226410020703 0ustar exp-double-e-1 = 1ee2 work/TOML-Tiny/t/toml-test/invalid/float/exp-double-e-2.t0000664000000000000000000000065714777226410020206 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/exp-double-e-2.toml0000664000000000000000000000002714777226410020705 0ustar exp-double-e-2 = 1e2e3 work/TOML-Tiny/t/toml-test/invalid/float/exp-double-us.t0000664000000000000000000000065514777226410020250 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/exp-double-us.toml0000664000000000000000000000002714777226410020751 0ustar exp-double-us = 1e__23 work/TOML-Tiny/t/toml-test/invalid/float/exp-leading-us.t0000664000000000000000000000065714777226410020403 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/exp-leading-us.toml0000664000000000000000000000002714777226410021102 0ustar exp-leading-us = 1e_23 work/TOML-Tiny/t/toml-test/invalid/float/exp-point-1.t0000664000000000000000000000065114777226410017634 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/exp-point-1.toml0000664000000000000000000000002414777226410020336 0ustar exp-point-1 = 1e2.3 work/TOML-Tiny/t/toml-test/invalid/float/exp-point-2.t0000664000000000000000000000065114777226410017635 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/exp-point-2.toml0000664000000000000000000000002314777226410020336 0ustar exp-point-2 = 1.e2 work/TOML-Tiny/t/toml-test/invalid/float/exp-trailing-us.t0000664000000000000000000000066114777226410020604 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/exp-trailing-us.toml0000664000000000000000000000003114777226410021303 0ustar exp-trailing-us = 1e_23_ work/TOML-Tiny/t/toml-test/invalid/float/inf-incomplete-1.t0000664000000000000000000000066314777226410020625 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/inf-incomplete-1.toml0000664000000000000000000000002614777226410021326 0ustar inf-incomplete-1 = in work/TOML-Tiny/t/toml-test/invalid/float/inf-incomplete-2.t0000664000000000000000000000066314777226410020626 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/inf-incomplete-2.toml0000664000000000000000000000002714777226410021330 0ustar inf-incomplete-2 = +in work/TOML-Tiny/t/toml-test/invalid/float/inf-incomplete-3.t0000664000000000000000000000066314777226410020627 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/inf-incomplete-3.toml0000664000000000000000000000002714777226410021331 0ustar inf-incomplete-3 = -in work/TOML-Tiny/t/toml-test/invalid/float/inf_underscore.t0000664000000000000000000000065714777226410020566 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/inf_underscore.toml0000664000000000000000000000002614777226410021264 0ustar inf_underscore = in_f work/TOML-Tiny/t/toml-test/invalid/float/leading-point-neg.t0000664000000000000000000000066514777226410021061 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/leading-point-neg.toml0000664000000000000000000000003414777226410021557 0ustar leading-point-neg = -.12345 work/TOML-Tiny/t/toml-test/invalid/float/leading-point-plus.t0000664000000000000000000000066714777226410021275 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/leading-point-plus.toml0000664000000000000000000000003514777226410021772 0ustar leading-point-plus = +.12345 work/TOML-Tiny/t/toml-test/invalid/float/leading-point.t0000664000000000000000000000065514777226410020311 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/leading-point.toml0000664000000000000000000000002714777226410021012 0ustar leading-point = .12345 work/TOML-Tiny/t/toml-test/invalid/float/leading-us.t0000664000000000000000000000064714777226410017610 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/leading-us.toml0000664000000000000000000000002214777226410020303 0ustar leading-us = _1.2 work/TOML-Tiny/t/toml-test/invalid/float/leading-zero-neg.t0000664000000000000000000000066314777226410020705 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/leading-zero-neg.toml0000664000000000000000000000003214777226410021403 0ustar leading-zero-neg = -03.14 work/TOML-Tiny/t/toml-test/invalid/float/leading-zero-plus.t0000664000000000000000000000066514777226410021121 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/leading-zero-plus.toml0000664000000000000000000000003314777226410021616 0ustar leading-zero-plus = +03.14 work/TOML-Tiny/t/toml-test/invalid/float/leading-zero.t0000664000000000000000000000065314777226410020135 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/leading-zero.toml0000664000000000000000000000002514777226410020636 0ustar leading-zero = 03.14 work/TOML-Tiny/t/toml-test/invalid/float/nan-incomplete-1.t0000664000000000000000000000066314777226410020625 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/nan-incomplete-1.toml0000664000000000000000000000002614777226410021326 0ustar nan-incomplete-1 = na work/TOML-Tiny/t/toml-test/invalid/float/nan-incomplete-2.t0000664000000000000000000000066314777226410020626 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/nan-incomplete-2.toml0000664000000000000000000000002714777226410021330 0ustar nan-incomplete-2 = +na work/TOML-Tiny/t/toml-test/invalid/float/nan-incomplete-3.t0000664000000000000000000000066314777226410020627 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/nan-incomplete-3.toml0000664000000000000000000000002714777226410021331 0ustar nan-incomplete-3 = -na work/TOML-Tiny/t/toml-test/invalid/float/nan_underscore.t0000664000000000000000000000065714777226410020566 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/nan_underscore.toml0000664000000000000000000000002614777226410021264 0ustar nan_underscore = na_n work/TOML-Tiny/t/toml-test/invalid/float/trailing-point-min.t0000664000000000000000000000066714777226410021303 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/trailing-point-min.toml0000664000000000000000000000003114777226410021774 0ustar trailing-point-min = -1. work/TOML-Tiny/t/toml-test/invalid/float/trailing-point-plus.t0000664000000000000000000000067114777226410021476 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/trailing-point-plus.toml0000664000000000000000000000003214777226410022175 0ustar trailing-point-plus = +1. work/TOML-Tiny/t/toml-test/invalid/float/trailing-point.t0000664000000000000000000000065714777226410020521 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/trailing-point.toml0000664000000000000000000000002414777226410021215 0ustar trailing-point = 1. work/TOML-Tiny/t/toml-test/invalid/float/trailing-us.t0000664000000000000000000000065114777226410020011 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/trailing-us.toml0000664000000000000000000000002314777226410020512 0ustar trailing-us = 1.2_ work/TOML-Tiny/t/toml-test/invalid/float/us-after-point.t0000664000000000000000000000065714777226410020436 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/us-after-point.toml0000664000000000000000000000002614777226410021134 0ustar us-after-point = 1._2 work/TOML-Tiny/t/toml-test/invalid/float/us-before-point.t0000664000000000000000000000066114777226410020572 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/float/us-before-point.toml0000664000000000000000000000002714777226410021276 0ustar us-before-point = 1_.2 work/TOML-Tiny/t/toml-test/invalid/inline-table/0000775000000000000000000000000014777226410016622 5ustar work/TOML-Tiny/t/toml-test/invalid/inline-table/double-comma.t0000664000000000000000000000067114777226410021357 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/inline-table/double-comma.toml0000664000000000000000000000001714777226410022061 0ustar t = {x=3,,y=4} work/TOML-Tiny/t/toml-test/invalid/inline-table/empty.t0000664000000000000000000000065314777226410020151 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/inline-table/empty.toml0000664000000000000000000000001014777226410020644 0ustar t = {,} work/TOML-Tiny/t/toml-test/invalid/inline-table/linebreak-1.t0000664000000000000000000000066714777226410021112 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/inline-table/linebreak-1.toml0000664000000000000000000000015714777226410021614 0ustar # No newlines are allowed between the curly braces unless they are valid within # a value. simple = { a = 1 } work/TOML-Tiny/t/toml-test/invalid/inline-table/linebreak-2.t0000664000000000000000000000066714777226410021113 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/inline-table/linebreak-2.toml0000664000000000000000000000001714777226410021610 0ustar t = {a=1, b=2} work/TOML-Tiny/t/toml-test/invalid/inline-table/linebreak-3.t0000664000000000000000000000066714777226410021114 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/inline-table/linebreak-3.toml0000664000000000000000000000001714777226410021611 0ustar t = {a=1 ,b=2} work/TOML-Tiny/t/toml-test/invalid/inline-table/linebreak-4.t0000664000000000000000000000066714777226410021115 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/inline-table/linebreak-4.toml0000664000000000000000000000011314777226410021607 0ustar json_like = { first = "Tom", last = "Preston-Werner" } work/TOML-Tiny/t/toml-test/invalid/inline-table/no-comma.t0000664000000000000000000000066114777226410020520 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/inline-table/no-comma.toml0000664000000000000000000000002214777226410021217 0ustar t = {x = 3 y = 4} work/TOML-Tiny/t/toml-test/invalid/inline-table/trailing-comma.t0000664000000000000000000000067514777226410021722 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/inline-table/trailing-comma.toml0000664000000000000000000000021414777226410022417 0ustar # A terminating comma (also called trailing comma) is not permitted after the # last key/value pair in an inline table abc = { abc = 123, } work/TOML-Tiny/t/toml-test/invalid/integer/0000775000000000000000000000000014777226410015714 5ustar work/TOML-Tiny/t/toml-test/invalid/integer/capital-bin.t0000664000000000000000000000065514777226410020272 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/capital-bin.toml0000664000000000000000000000002214777226410020766 0ustar capital-bin = 0B0 work/TOML-Tiny/t/toml-test/invalid/integer/capital-hex.t0000664000000000000000000000065514777226410020306 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/capital-hex.toml0000664000000000000000000000002214777226410021002 0ustar capital-hex = 0X1 work/TOML-Tiny/t/toml-test/invalid/integer/capital-oct.t0000664000000000000000000000065514777226410020307 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/capital-oct.toml0000664000000000000000000000002214777226410021003 0ustar capital-oct = 0O0 work/TOML-Tiny/t/toml-test/invalid/integer/double-sign-nex.t0000664000000000000000000000066514777226410021110 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/double-sign-nex.toml0000664000000000000000000000002714777226410021610 0ustar double-sign-nex = --99 work/TOML-Tiny/t/toml-test/invalid/integer/double-sign-plus.t0000664000000000000000000000066714777226410021303 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/double-sign-plus.toml0000664000000000000000000000003014777226410021773 0ustar double-sign-plus = ++99 work/TOML-Tiny/t/toml-test/invalid/integer/double-us.t0000664000000000000000000000065114777226410020002 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/double-us.toml0000664000000000000000000000002214777226410020502 0ustar double-us = 1__23 work/TOML-Tiny/t/toml-test/invalid/integer/invalid-bin.t0000664000000000000000000000065514777226410020303 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/invalid-bin.toml0000664000000000000000000000002514777226410021002 0ustar invalid-bin = 0b0012 work/TOML-Tiny/t/toml-test/invalid/integer/invalid-hex.t0000664000000000000000000000065514777226410020317 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/invalid-hex.toml0000664000000000000000000000002514777226410021016 0ustar invalid-hex = 0xaafz work/TOML-Tiny/t/toml-test/invalid/integer/invalid-oct.t0000664000000000000000000000065514777226410020320 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/invalid-oct.toml0000664000000000000000000000002414777226410021016 0ustar invalid-oct = 0o778 work/TOML-Tiny/t/toml-test/invalid/integer/leading-us-bin.t0000664000000000000000000000066314777226410020704 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/leading-us-bin.toml0000664000000000000000000000002614777226410021405 0ustar leading-us-bin = _0o1 work/TOML-Tiny/t/toml-test/invalid/integer/leading-us-hex.t0000664000000000000000000000066314777226410020720 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/leading-us-hex.toml0000664000000000000000000000002614777226410021421 0ustar leading-us-hex = _0o1 work/TOML-Tiny/t/toml-test/invalid/integer/leading-us-oct.t0000664000000000000000000000066314777226410020721 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/leading-us-oct.toml0000664000000000000000000000002614777226410021422 0ustar leading-us-oct = _0o1 work/TOML-Tiny/t/toml-test/invalid/integer/leading-us.t0000664000000000000000000000065314777226410020135 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/leading-us.toml0000664000000000000000000000002214777226410020633 0ustar leading-us = _123 work/TOML-Tiny/t/toml-test/invalid/integer/leading-zero-1.t0000664000000000000000000000066314777226410020624 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/leading-zero-1.toml0000664000000000000000000000002414777226410021323 0ustar leading-zero-1 = 01 work/TOML-Tiny/t/toml-test/invalid/integer/leading-zero-2.t0000664000000000000000000000066314777226410020625 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/leading-zero-2.toml0000664000000000000000000000002414777226410021324 0ustar leading-zero-2 = 00 work/TOML-Tiny/t/toml-test/invalid/integer/leading-zero-sign-1.t0000664000000000000000000000067514777226410021565 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/leading-zero-sign-1.toml0000664000000000000000000000003214777226410022260 0ustar leading-zero-sign-1 = -01 work/TOML-Tiny/t/toml-test/invalid/integer/leading-zero-sign-2.t0000664000000000000000000000067514777226410021566 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/leading-zero-sign-2.toml0000664000000000000000000000003214777226410022261 0ustar leading-zero-sign-2 = +01 work/TOML-Tiny/t/toml-test/invalid/integer/negative-bin.t0000664000000000000000000000065714777226410020461 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/negative-bin.toml0000664000000000000000000000003314777226410021155 0ustar negative-bin = -0b11010110 work/TOML-Tiny/t/toml-test/invalid/integer/negative-hex.t0000664000000000000000000000065714777226410020475 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/negative-hex.toml0000664000000000000000000000002514777226410021172 0ustar negative-hex = -0xff work/TOML-Tiny/t/toml-test/invalid/integer/negative-oct.t0000664000000000000000000000065714777226410020476 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/negative-oct.toml0000664000000000000000000000002514777226410021173 0ustar negative-oct = -0o99 work/TOML-Tiny/t/toml-test/invalid/integer/positive-bin.t0000664000000000000000000000065714777226410020521 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/positive-bin.toml0000664000000000000000000000003314777226410021215 0ustar positive-bin = +0b11010110 work/TOML-Tiny/t/toml-test/invalid/integer/positive-hex.t0000664000000000000000000000065714777226410020535 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/positive-hex.toml0000664000000000000000000000002514777226410021232 0ustar positive-hex = +0xff work/TOML-Tiny/t/toml-test/invalid/integer/positive-oct.t0000664000000000000000000000065714777226410020536 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/positive-oct.toml0000664000000000000000000000002514777226410021233 0ustar positive-oct = +0o99 work/TOML-Tiny/t/toml-test/invalid/integer/text-after-integer.t0000664000000000000000000000067314777226410021625 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/text-after-integer.toml0000664000000000000000000000004114777226410022322 0ustar answer = 42 the ultimate answer? work/TOML-Tiny/t/toml-test/invalid/integer/trailing-us-bin.t0000664000000000000000000000066514777226410021114 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/trailing-us-bin.toml0000664000000000000000000000002714777226410021614 0ustar trailing-us-bin = 0b1_ work/TOML-Tiny/t/toml-test/invalid/integer/trailing-us-hex.t0000664000000000000000000000066514777226410021130 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/trailing-us-hex.toml0000664000000000000000000000002714777226410021630 0ustar trailing-us-hex = 0x1_ work/TOML-Tiny/t/toml-test/invalid/integer/trailing-us-oct.t0000664000000000000000000000066514777226410021131 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/trailing-us-oct.toml0000664000000000000000000000002714777226410021631 0ustar trailing-us-oct = 0o1_ work/TOML-Tiny/t/toml-test/invalid/integer/trailing-us.t0000664000000000000000000000065514777226410020345 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/trailing-us.toml0000664000000000000000000000002314777226410021042 0ustar trailing-us = 123_ work/TOML-Tiny/t/toml-test/invalid/integer/us-after-bin.t0000664000000000000000000000065714777226410020405 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/us-after-bin.toml0000664000000000000000000000002414777226410021101 0ustar us-after-bin = 0b_1 work/TOML-Tiny/t/toml-test/invalid/integer/us-after-hex.t0000664000000000000000000000065714777226410020421 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/us-after-hex.toml0000664000000000000000000000002414777226410021115 0ustar us-after-hex = 0x_1 work/TOML-Tiny/t/toml-test/invalid/integer/us-after-oct.t0000664000000000000000000000065714777226410020422 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/integer/us-after-oct.toml0000664000000000000000000000002414777226410021116 0ustar us-after-oct = 0o_1 work/TOML-Tiny/t/toml-test/invalid/key/0000775000000000000000000000000014777226410015047 5ustar work/TOML-Tiny/t/toml-test/invalid/key/after-array.t0000664000000000000000000000064514777226410017456 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/after-array.toml0000664000000000000000000000004014777226410020153 0ustar [[agencies]] owner = "S Cjelli" work/TOML-Tiny/t/toml-test/invalid/key/after-table.t0000664000000000000000000000064514777226410017427 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/after-table.toml0000664000000000000000000000004414777226410020130 0ustar [error] this = "should not be here" work/TOML-Tiny/t/toml-test/invalid/key/after-value.t0000664000000000000000000000064514777226410017454 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/after-value.toml0000664000000000000000000000006014777226410020153 0ustar first = "Tom" last = "Preston-Werner" # INVALID work/TOML-Tiny/t/toml-test/invalid/key/bare-invalid-character.t0000664000000000000000000000067314777226410021531 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/bare-invalid-character.toml0000664000000000000000000000001714777226410022231 0ustar bare!key = 123 work/TOML-Tiny/t/toml-test/invalid/key/dotted-redefine-table.t0000664000000000000000000000067114777226410021367 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/dotted-redefine-table.toml0000664000000000000000000000011414777226410022067 0ustar # Defined a.b as int a.b = 1 # Tries to access it as table: error a.b.c = 2 work/TOML-Tiny/t/toml-test/invalid/key/duplicate-keys.t0000664000000000000000000000065314777226410020163 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/duplicate-keys.toml0000664000000000000000000000003114777226410020661 0ustar dupe = false dupe = true work/TOML-Tiny/t/toml-test/invalid/key/duplicate.t0000664000000000000000000000064114777226410017207 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/duplicate.toml0000664000000000000000000000005714777226410017720 0ustar # DO NOT DO THIS name = "Tom" name = "Pradyun" work/TOML-Tiny/t/toml-test/invalid/key/empty.t0000664000000000000000000000063114777226410016372 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/empty.toml0000664000000000000000000000000514777226410017075 0ustar = 1 work/TOML-Tiny/t/toml-test/invalid/key/escape.t0000664000000000000000000000063314777226410016476 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/escape.toml0000664000000000000000000000005514777226410017204 0ustar \u00c0 = "latin capital letter A with grave" work/TOML-Tiny/t/toml-test/invalid/key/hash.t0000664000000000000000000000062714777226410016164 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/hash.toml0000664000000000000000000000000714777226410016664 0ustar a# = 1 work/TOML-Tiny/t/toml-test/invalid/key/multiline.t0000664000000000000000000000064114777226410017237 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/multiline.toml0000664000000000000000000000002314777226410017741 0ustar """long key""" = 1 work/TOML-Tiny/t/toml-test/invalid/key/newline.t0000664000000000000000000000063514777226410016701 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/newline.toml0000664000000000000000000000002114777226410017376 0ustar barekey = 123 work/TOML-Tiny/t/toml-test/invalid/key/no-eol.t0000664000000000000000000000063314777226410016427 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/no-eol.toml0000664000000000000000000000001414777226410017130 0ustar a = 1 b = 2 work/TOML-Tiny/t/toml-test/invalid/key/open-bracket.t0000664000000000000000000000064714777226410017615 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/open-bracket.toml0000664000000000000000000000001114777226410020306 0ustar [abc = 1 work/TOML-Tiny/t/toml-test/invalid/key/partial-quoted.t0000664000000000000000000000065314777226410020173 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/partial-quoted.toml0000664000000000000000000000002414777226410020673 0ustar partial"quoted" = 5 work/TOML-Tiny/t/toml-test/invalid/key/single-open-bracket.t0000664000000000000000000000066514777226410021074 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/single-open-bracket.toml0000664000000000000000000000000214777226410021565 0ustar [ work/TOML-Tiny/t/toml-test/invalid/key/space.t0000664000000000000000000000063114777226410016327 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/space.toml0000664000000000000000000000001014777226410017026 0ustar a b = 1 work/TOML-Tiny/t/toml-test/invalid/key/special-character.t0000664000000000000000000000066114777226410020611 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/special-character.toml0000664000000000000000000000003514777226410021314 0ustar μ = "greek small letter mu" work/TOML-Tiny/t/toml-test/invalid/key/start-bracket.t0000664000000000000000000000065114777226410020004 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/start-bracket.toml0000664000000000000000000000002114777226410020503 0ustar [a] [xyz = 5 [b] work/TOML-Tiny/t/toml-test/invalid/key/two-equals.t0000664000000000000000000000064314777226410017340 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/two-equals.toml0000664000000000000000000000001114777226410020035 0ustar key= = 1 work/TOML-Tiny/t/toml-test/invalid/key/two-equals2.t0000664000000000000000000000064514777226410017424 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/two-equals2.toml0000664000000000000000000000000514777226410020122 0ustar a==1 work/TOML-Tiny/t/toml-test/invalid/key/two-equals3.t0000664000000000000000000000064514777226410017425 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/two-equals3.toml0000664000000000000000000000000614777226410020124 0ustar a=b=1 work/TOML-Tiny/t/toml-test/invalid/key/without-value-1.t0000664000000000000000000000065514777226410020215 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/without-value-1.toml0000664000000000000000000000000414777226410020711 0ustar key work/TOML-Tiny/t/toml-test/invalid/key/without-value-2.t0000664000000000000000000000065514777226410020216 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/key/without-value-2.toml0000664000000000000000000000000714777226410020715 0ustar key = work/TOML-Tiny/t/toml-test/invalid/string/0000775000000000000000000000000014777226410015565 5ustar work/TOML-Tiny/t/toml-test/invalid/string/bad-byte-escape.t0000664000000000000000000000066314777226410020704 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/bad-byte-escape.toml0000664000000000000000000000002114777226410021400 0ustar naughty = "\xAg" work/TOML-Tiny/t/toml-test/invalid/string/bad-codepoint.t0000664000000000000000000000065714777226410020472 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/bad-codepoint.toml0000664000000000000000000000012114777226410021164 0ustar invalid-codepoint = "This string contains a non scalar unicode codepoint \uD801" work/TOML-Tiny/t/toml-test/invalid/string/bad-concat.t0000664000000000000000000000065114777226410017747 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/bad-concat.toml0000664000000000000000000000003514777226410020453 0ustar no_concat = "first" "second" work/TOML-Tiny/t/toml-test/invalid/string/bad-escape.t0000664000000000000000000000065114777226410017740 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/bad-escape.toml0000664000000000000000000000007614777226410020451 0ustar invalid-escape = "This string has a bad \a escape character." work/TOML-Tiny/t/toml-test/invalid/string/bad-multiline.t0000664000000000000000000000065714777226410020510 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/bad-multiline.toml0000664000000000000000000000004114777226410021203 0ustar multi = "first line second line" work/TOML-Tiny/t/toml-test/invalid/string/bad-slash-escape.t0000664000000000000000000000066514777226410021055 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/bad-slash-escape.toml0000664000000000000000000000007614777226410021561 0ustar invalid-escape = "This string has a bad \/ escape character." work/TOML-Tiny/t/toml-test/invalid/string/bad-uni-esc.t0000664000000000000000000000065314777226410020045 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/bad-uni-esc.toml0000664000000000000000000000001714777226410020547 0ustar str = "val\ue" work/TOML-Tiny/t/toml-test/invalid/string/basic-byte-escapes.t0000664000000000000000000000067114777226410021421 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/basic-byte-escapes.toml0000664000000000000000000000002014777226410022115 0ustar answer = "\x33" work/TOML-Tiny/t/toml-test/invalid/string/basic-multiline-out-of-range-unicode-escape-1.t0000664000000000000000000000075714777226410026365 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/basic-multiline-out-of-range-unicode-escape-1.toml0000664000000000000000000000002514777226410027061 0ustar a = """\UFFFFFFFF""" work/TOML-Tiny/t/toml-test/invalid/string/basic-multiline-out-of-range-unicode-escape-2.t0000664000000000000000000000075714777226410026366 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/basic-multiline-out-of-range-unicode-escape-2.toml0000664000000000000000000000002514777226410027062 0ustar a = """\U00D80000""" work/TOML-Tiny/t/toml-test/invalid/string/basic-multiline-quotes.t0000664000000000000000000000070114777226410022347 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/basic-multiline-quotes.toml0000664000000000000000000000006214777226410023057 0ustar str5 = """Here are three quotation marks: """.""" work/TOML-Tiny/t/toml-test/invalid/string/basic-multiline-unknown-escape.t0000664000000000000000000000072114777226410023766 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/basic-multiline-unknown-escape.toml0000664000000000000000000000001514777226410024472 0ustar a = """\@""" work/TOML-Tiny/t/toml-test/invalid/string/basic-out-of-range-unicode-escape-1.t0000664000000000000000000000073314777226410024357 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/basic-out-of-range-unicode-escape-1.toml0000664000000000000000000000002114777226410025055 0ustar a = "\UFFFFFFFF" work/TOML-Tiny/t/toml-test/invalid/string/basic-out-of-range-unicode-escape-2.t0000664000000000000000000000073314777226410024360 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/basic-out-of-range-unicode-escape-2.toml0000664000000000000000000000002114777226410025056 0ustar a = "\U00D80000" work/TOML-Tiny/t/toml-test/invalid/string/basic-unknown-escape.t0000664000000000000000000000067514777226410021776 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/basic-unknown-escape.toml0000664000000000000000000000001114777226410022466 0ustar a = "\@" work/TOML-Tiny/t/toml-test/invalid/string/literal-multiline-quotes-1.t0000664000000000000000000000071114777226410023061 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/literal-multiline-quotes-1.toml0000664000000000000000000000003614777226410023571 0ustar a = '''6 apostrophes: '''''' work/TOML-Tiny/t/toml-test/invalid/string/literal-multiline-quotes-2.t0000664000000000000000000000071114777226410023062 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/literal-multiline-quotes-2.toml0000664000000000000000000000005214777226410023570 0ustar a = '''15 apostrophes: '''''''''''''''''' work/TOML-Tiny/t/toml-test/invalid/string/missing-quotes.t0000664000000000000000000000066114777226410020744 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/missing-quotes.toml0000664000000000000000000000001514777226410021445 0ustar name = value work/TOML-Tiny/t/toml-test/invalid/string/multiline-escape-space.t0000664000000000000000000000070114777226410022301 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/multiline-escape-space.toml0000664000000000000000000000003414777226410023010 0ustar a = """ foo \ \n bar""" work/TOML-Tiny/t/toml-test/invalid/string/multiline-no-close-2.t0000664000000000000000000000067514777226410021640 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/multiline-no-close-2.toml0000664000000000000000000000000614777226410022334 0ustar x=""" work/TOML-Tiny/t/toml-test/invalid/string/multiline-no-close.t0000664000000000000000000000067114777226410021475 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/multiline-no-close.toml0000664000000000000000000000004114777226410022174 0ustar invalid = """ this will fail work/TOML-Tiny/t/toml-test/invalid/string/multiline-quotes-1.t0000664000000000000000000000067114777226410021434 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/multiline-quotes-1.toml0000664000000000000000000000003014777226410022131 0ustar a = """6 quotes: """""" work/TOML-Tiny/t/toml-test/invalid/string/multiline-quotes-2.t0000664000000000000000000000067114777226410021435 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/multiline-quotes-2.toml0000664000000000000000000000003014777226410022132 0ustar a = """6 quotes: """""" work/TOML-Tiny/t/toml-test/invalid/string/no-close.t0000664000000000000000000000064514777226410017476 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/no-close.toml0000664000000000000000000000005214777226410020176 0ustar no-ending-quote = "One time, at band camp work/TOML-Tiny/t/toml-test/invalid/string/text-after-string.t0000664000000000000000000000066714777226410021352 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/text-after-string.toml0000664000000000000000000000005414777226410022050 0ustar string = "Is there life after strings?" No. work/TOML-Tiny/t/toml-test/invalid/string/wrong-close.t0000664000000000000000000000065314777226410020215 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/string/wrong-close.toml0000664000000000000000000000004714777226410020722 0ustar bad-ending-quote = "double and single' work/TOML-Tiny/t/toml-test/invalid/table/0000775000000000000000000000000014777226410015346 5ustar work/TOML-Tiny/t/toml-test/invalid/table/array-empty.t0000664000000000000000000000065114777226410020007 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/table/array-empty.toml0000664000000000000000000000003214777226410020510 0ustar [[]] name = "Born to Run" work/TOML-Tiny/t/toml-test/invalid/table/array-implicit.t0000664000000000000000000000065714777226410020471 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/table/array-implicit.toml0000664000000000000000000000115614777226410021174 0ustar # 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" work/TOML-Tiny/t/toml-test/invalid/table/array-missing-bracket.t0000664000000000000000000000067514777226410021741 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/table/array-missing-bracket.toml0000664000000000000000000000003714777226410022441 0ustar [[albums] name = "Born to Run" work/TOML-Tiny/t/toml-test/invalid/table/duplicate-key-table.t0000664000000000000000000000067114777226410021364 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/table/duplicate-key-table.toml0000664000000000000000000000006314777226410022067 0ustar [fruit] type = "apple" [fruit.type] apple = "yes" work/TOML-Tiny/t/toml-test/invalid/table/duplicate-table-array.t0000664000000000000000000000067514777226410021716 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/table/duplicate-table-array.toml0000664000000000000000000000001614777226410022413 0ustar [tbl] [[tbl]] work/TOML-Tiny/t/toml-test/invalid/table/duplicate-table-array2.t0000664000000000000000000000067714777226410022002 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/table/duplicate-table-array2.toml0000664000000000000000000000001614777226410022475 0ustar [[tbl]] [tbl] work/TOML-Tiny/t/toml-test/invalid/table/duplicate.t0000664000000000000000000000064514777226410017512 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/table/duplicate.toml0000664000000000000000000000002514777226410020212 0ustar [a] b = 1 [a] c = 2 work/TOML-Tiny/t/toml-test/invalid/table/empty-implicit-table.t0000664000000000000000000000067314777226410021574 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/table/empty-implicit-table.toml0000664000000000000000000000002314777226410022271 0ustar [naughty..naughty] work/TOML-Tiny/t/toml-test/invalid/table/empty.t0000664000000000000000000000063514777226410016675 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/table/empty.toml0000664000000000000000000000000314777226410017372 0ustar [] work/TOML-Tiny/t/toml-test/invalid/table/equals-sign.t0000664000000000000000000000065114777226410017765 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/table/equals-sign.toml0000664000000000000000000000001314777226410020465 0ustar [name=bad] work/TOML-Tiny/t/toml-test/invalid/table/llbrace.t0000664000000000000000000000064114777226410017140 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/table/llbrace.toml0000664000000000000000000000001314777226410017641 0ustar [ [table]] work/TOML-Tiny/t/toml-test/invalid/table/nested-brackets-close.t0000664000000000000000000000067514777226410021724 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/table/nested-brackets-close.toml0000664000000000000000000000001714777226410022422 0ustar [a]b] zyx = 42 work/TOML-Tiny/t/toml-test/invalid/table/nested-brackets-open.t0000664000000000000000000000067314777226410021556 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/table/nested-brackets-open.toml0000664000000000000000000000001714777226410022256 0ustar [a[b] zyx = 42 work/TOML-Tiny/t/toml-test/invalid/table/quoted-no-close.t0000664000000000000000000000066114777226410020554 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/table/quoted-no-close.toml0000664000000000000000000000004214777226410021255 0ustar ["where will it end] name = value work/TOML-Tiny/t/toml-test/invalid/table/redefine.t0000664000000000000000000000064314777226410017317 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/table/redefine.toml0000664000000000000000000000011614777226410020022 0ustar # Define b as int, and try to use it as a table: error [a] b = 1 [a.b] c = 2 work/TOML-Tiny/t/toml-test/invalid/table/rrbrace.t0000664000000000000000000000064114777226410017154 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/table/rrbrace.toml0000664000000000000000000000001314777226410017655 0ustar [[table] ] work/TOML-Tiny/t/toml-test/invalid/table/text-after-table.t0000664000000000000000000000066314777226410020710 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/table/text-after-table.toml0000664000000000000000000000003714777226410021413 0ustar [error] this shouldn't be here work/TOML-Tiny/t/toml-test/invalid/table/whitespace.t0000664000000000000000000000064714777226410017676 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/table/whitespace.toml0000664000000000000000000000001614777226410020374 0ustar [invalid key] work/TOML-Tiny/t/toml-test/invalid/table/with-pound.t0000664000000000000000000000064714777226410017640 0ustar # File automatically generated from BurntSushi/toml-test use 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;work/TOML-Tiny/t/toml-test/invalid/table/with-pound.toml0000664000000000000000000000003014777226410020332 0ustar [key#group] answer = 42 work/TOML-Tiny/t/toml-test/valid/0000775000000000000000000000000014777226410013730 5ustar work/TOML-Tiny/t/toml-test/valid/array/0000775000000000000000000000000014777226410015046 5ustar work/TOML-Tiny/t/toml-test/valid/array/array.t0000664000000000000000000002615414777226410016361 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/array/array.toml0000664000000000000000000000031514777226410017060 0ustar 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 ] work/TOML-Tiny/t/toml-test/valid/array/bool.t0000664000000000000000000000246614777226410016176 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/array/bool.toml0000664000000000000000000000002214777226410016670 0ustar a = [true, false] work/TOML-Tiny/t/toml-test/valid/array/empty.t0000664000000000000000000000300414777226410016366 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/array/empty.toml0000664000000000000000000000002514777226410017076 0ustar thevoid = [[[[[]]]]] work/TOML-Tiny/t/toml-test/valid/array/hetergeneous.t0000664000000000000000000001446614777226410017743 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/array/hetergeneous.toml0000664000000000000000000000005114777226410020434 0ustar mixed = [[1, 2], ["a", "b"], [1.1, 2.1]] work/TOML-Tiny/t/toml-test/valid/array/mixed-int-array.t0000664000000000000000000000544314777226410020253 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/array/mixed-int-array.toml0000664000000000000000000000006514777226410020756 0ustar arrays-and-ints = [1, ["Arrays are not integers."]] work/TOML-Tiny/t/toml-test/valid/array/mixed-int-float.t0000664000000000000000000000774214777226410020246 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/array/mixed-int-float.toml0000664000000000000000000000003314777226410020740 0ustar ints-and-floats = [1, 1.1] work/TOML-Tiny/t/toml-test/valid/array/mixed-int-string.t0000664000000000000000000000532514777226410020442 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/array/mixed-int-string.toml0000664000000000000000000000003614777226410021144 0ustar strings-and-ints = ["hi", 42] work/TOML-Tiny/t/toml-test/valid/array/mixed-string-table.t0000664000000000000000000000324614777226410020737 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/array/mixed-string-table.toml0000664000000000000000000000021314777226410021436 0ustar contributors = [ "Foo Bar ", { name = "Baz Qux", email = "bazqux@example.com", url = "https://example.com/bazqux" } ] work/TOML-Tiny/t/toml-test/valid/array/nested-double.t0000664000000000000000000001233014777226410017764 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/array/nested-double.toml0000664000000000000000000000005014777226410020470 0ustar nest = [ [ ["a"], [1, 2, [3]] ] ] work/TOML-Tiny/t/toml-test/valid/array/nested-inline-table.t0000664000000000000000000000262514777226410021063 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/array/nested-inline-table.toml0000664000000000000000000000002314777226410021561 0ustar a = [ { b = {} } ] work/TOML-Tiny/t/toml-test/valid/array/nested.t0000664000000000000000000000270614777226410016522 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/array/nested.toml0000664000000000000000000000002614777226410017223 0ustar nest = [["a"], ["b"]] work/TOML-Tiny/t/toml-test/valid/array/nospaces.t0000664000000000000000000001127214777226410017051 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/array/nospaces.toml0000664000000000000000000000001714777226410017554 0ustar ints = [1,2,3] work/TOML-Tiny/t/toml-test/valid/array/string-quote-comma-2.t0000664000000000000000000000255514777226410021134 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/array/string-quote-comma-2.toml0000664000000000000000000000002414777226410021631 0ustar title = [ " \", ",] work/TOML-Tiny/t/toml-test/valid/array/string-quote-comma.t0000664000000000000000000000264514777226410020775 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/array/string-quote-comma.toml0000664000000000000000000000007014777226410021473 0ustar title = [ "Client: \"XXXX\", Job: XXXX", "Code: XXXX" ] work/TOML-Tiny/t/toml-test/valid/array/string-with-comma.t0000664000000000000000000000263514777226410020612 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/array/string-with-comma.toml0000664000000000000000000000006414777226410021314 0ustar title = [ "Client: XXXX, Job: XXXX", "Code: XXXX" ] work/TOML-Tiny/t/toml-test/valid/array/strings.t0000664000000000000000000000273014777226410016726 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/array/strings.toml0000664000000000000000000000010314777226410017426 0ustar string_array = [ "all", 'strings', """are the same""", '''type'''] work/TOML-Tiny/t/toml-test/valid/array/table-array-string-backslash.t0000664000000000000000000000272014777226410022674 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/array/table-array-string-backslash.toml0000664000000000000000000000003714777226410023403 0ustar foo = [ { bar="\"{{baz}}\""} ] work/TOML-Tiny/t/toml-test/valid/bool/0000775000000000000000000000000014777226410014663 5ustar work/TOML-Tiny/t/toml-test/valid/bool/bool.t0000664000000000000000000000277514777226410016016 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; use constant CORE_BOOL => defined &builtin::is_bool; local $Data::Dumper::Sortkeys = 1; local $Data::Dumper::Useqq = 1; binmode STDIN, ':encoding(UTF-8)'; binmode STDOUT, ':encoding(UTF-8)'; open my $fh, '<', "./t/toml-test/valid/bool/bool.toml" or die $!; binmode $fh, ':encoding(UTF-8)'; my $toml = do{ local $/; <$fh>; }; close $fh; my $expected1 = { "f" => 0, "t" => 1 }; my $actual = from_toml($toml); is($actual, $expected1, 'bool/bool - from_toml') or do{ diag 'TOML INPUT:'; diag "$toml"; diag ''; diag 'EXPECTED:'; diag Dumper($expected1); diag ''; diag 'ACTUAL:'; diag Dumper($actual); }; my $regenerated = to_toml $actual; my $reparsed = eval{ scalar from_toml $regenerated }; my $error = $@; ok(!$error, 'bool/bool - to_toml - no errors') or diag $error; is($reparsed, $expected1, 'bool/bool - to_toml') or do{ diag "ERROR: $error" if $error; diag ''; diag 'PARSED FROM TEST SOURCE TOML:'; diag Dumper($actual); diag ''; diag 'REGENERATED TOML:'; diag $regenerated; diag ''; diag 'REPARSED FROM REGENERATED TOML:'; diag Dumper($reparsed); }; subtest 'builtin booleans' => sub { plan skip_all => 'No builtin::is_bool', unless CORE_BOOL; my $data = { t => !!1, f => !!0 }; my $toml = to_toml($data); is $toml, $regenerated; }; done_testing; work/TOML-Tiny/t/toml-test/valid/bool/bool.toml0000664000000000000000000000002314777226410016506 0ustar t = true f = false work/TOML-Tiny/t/toml-test/valid/comment/0000775000000000000000000000000014777226410015372 5ustar work/TOML-Tiny/t/toml-test/valid/comment/at-eof.t0000664000000000000000000000240114777226410016727 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/comment/at-eof.toml0000664000000000000000000000012514777226410017440 0ustar # This is a full-line comment key = "value" # This is a comment at the end of a line work/TOML-Tiny/t/toml-test/valid/comment/at-eof2.t0000664000000000000000000000240514777226410017015 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/comment/at-eof2.toml0000664000000000000000000000012514777226410017522 0ustar # This is a full-line comment key = "value" # This is a comment at the end of a line work/TOML-Tiny/t/toml-test/valid/comment/everywhere.t0000664000000000000000000001277114777226410017754 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/comment/everywhere.toml0000664000000000000000000000105414777226410020454 0ustar # 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 work/TOML-Tiny/t/toml-test/valid/comment/tricky.t0000664000000000000000000003326414777226410017074 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/comment/tricky.toml0000664000000000000000000000060114777226410017571 0ustar [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 = { "#" = '}#'}#}} work/TOML-Tiny/t/toml-test/valid/datetime/0000775000000000000000000000000014777226410015524 5ustar work/TOML-Tiny/t/toml-test/valid/datetime/datetime.t0000664000000000000000000000252014777226410017504 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/datetime/datetime.toml0000664000000000000000000000007214777226410020214 0ustar space = 1987-07-05 17:45:00Z lower = 1987-07-05t17:45:00z work/TOML-Tiny/t/toml-test/valid/datetime/local-date.t0000664000000000000000000000244214777226410017720 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/datetime/local-date.toml0000664000000000000000000000003114777226410020420 0ustar bestdayever = 1987-07-05 work/TOML-Tiny/t/toml-test/valid/datetime/local-time.t0000664000000000000000000000252214777226410017740 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/datetime/local-time.toml0000664000000000000000000000006414777226410020447 0ustar besttimeever = 17:45:00 milliseconds = 10:32:00.555 work/TOML-Tiny/t/toml-test/valid/datetime/local.t0000664000000000000000000000256714777226410017015 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/datetime/local.toml0000664000000000000000000000013014777226410017505 0ustar local = 1987-07-05T17:45:00 milli = 1977-12-21T10:32:00.555 space = 1987-07-05 17:45:00 work/TOML-Tiny/t/toml-test/valid/datetime/milliseconds.t0000664000000000000000000000276414777226410020407 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/datetime/milliseconds.toml0000664000000000000000000000022014777226410021100 0ustar 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 work/TOML-Tiny/t/toml-test/valid/datetime/timezone.t0000664000000000000000000000267514777226410017555 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/datetime/timezone.toml0000664000000000000000000000020614777226410020251 0ustar 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 work/TOML-Tiny/t/toml-test/valid/empty-file.t0000664000000000000000000000230314777226410016166 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/empty-file.toml0000664000000000000000000000000014777226410016666 0ustar work/TOML-Tiny/t/toml-test/valid/example.t0000664000000000000000000001402114777226410015546 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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; work/TOML-Tiny/t/toml-test/valid/example.toml0000664000000000000000000000013314777226410016255 0ustar best-day-ever = 1987-07-05T17:45:00Z [numtheory] boring = false perfection = [6, 28, 496] work/TOML-Tiny/t/toml-test/valid/float/0000775000000000000000000000000014777226410015035 5ustar work/TOML-Tiny/t/toml-test/valid/float/exponent.t0000664000000000000000000002473214777226410017072 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/float/exponent.toml0000664000000000000000000000016214777226410017571 0ustar lower = 3e2 upper = 3E2 neg = 3e-2 pos = 3E+2 zero = 3e0 pointlower = 3.1e2 pointupper = 3.1E2 minustenth = -1E-1 work/TOML-Tiny/t/toml-test/valid/float/float.t0000664000000000000000000001350014777226410016326 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/float/float.toml0000664000000000000000000000007314777226410017037 0ustar pi = 3.14 pospi = +3.14 negpi = -3.14 zero-intpart = 0.123 work/TOML-Tiny/t/toml-test/valid/float/inf-and-nan.t0000664000000000000000000001760614777226410017322 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/float/inf-and-nan.toml0000664000000000000000000000035014777226410020016 0ustar # 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 work/TOML-Tiny/t/toml-test/valid/float/long.t0000664000000000000000000000715514777226410016171 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/float/long.toml0000664000000000000000000000007214777226410016670 0ustar longpi = 3.141592653589793 neglongpi = -3.141592653589793 work/TOML-Tiny/t/toml-test/valid/float/underscore.t0000664000000000000000000001133714777226410017400 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/float/underscore.toml0000664000000000000000000000007014777226410020100 0ustar before = 3_141.5927 after = 3141.592_7 exponent = 3e1_4 work/TOML-Tiny/t/toml-test/valid/float/zero.t0000664000000000000000000002140014777226410016176 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/float/zero.toml0000664000000000000000000000010414777226410016704 0ustar f1 = 0.0 f2 = +0.0 f3 = -0.0 f4 = 0e0 f5 = 0e00 f6 = +0e0 f7 = -0e0 work/TOML-Tiny/t/toml-test/valid/implicit-and-explicit-after.t0000664000000000000000000001053214777226410021406 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/implicit-and-explicit-after.toml0000664000000000000000000000004514777226410022114 0ustar [a.b.c] answer = 42 [a] better = 43 work/TOML-Tiny/t/toml-test/valid/implicit-and-explicit-before.t0000664000000000000000000001053614777226410021553 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/implicit-and-explicit-before.toml0000664000000000000000000000004514777226410022255 0ustar [a] better = 43 [a.b.c] answer = 42 work/TOML-Tiny/t/toml-test/valid/implicit-groups.t0000664000000000000000000000600314777226410017243 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/implicit-groups.toml0000664000000000000000000000002414777226410017750 0ustar [a.b.c] answer = 42 work/TOML-Tiny/t/toml-test/valid/inline-table/0000775000000000000000000000000014777226410016273 5ustar work/TOML-Tiny/t/toml-test/valid/inline-table/array.t0000664000000000000000000000346614777226410017607 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/inline-table/array.toml0000664000000000000000000000025214777226410020305 0ustar people = [{first_name = "Bruce", last_name = "Springsteen"}, {first_name = "Eric", last_name = "Clapton"}, {first_name = "Bob", last_name = "Seger"}] work/TOML-Tiny/t/toml-test/valid/inline-table/bool.t0000664000000000000000000000254014777226410017414 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/inline-table/bool.toml0000664000000000000000000000003214777226410020116 0ustar a = {a = true, b = false} work/TOML-Tiny/t/toml-test/valid/inline-table/empty.t0000664000000000000000000001223514777226410017621 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/inline-table/empty.toml0000664000000000000000000000023514777226410020326 0ustar empty1 = {} empty2 = { } empty_in_array = [ { not_empty = 1 }, {} ] empty_in_array2 = [{},{not_empty=1}] many_empty = [{},{},{}] nested_empty = {"empty"={}} work/TOML-Tiny/t/toml-test/valid/inline-table/end-in-bool.t0000664000000000000000000000273314777226410020570 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/inline-table/end-in-bool.toml0000664000000000000000000000010614777226410021270 0ustar black = { python=">3.6", version=">=18.9b0", allow_prereleases=true } work/TOML-Tiny/t/toml-test/valid/inline-table/inline-table.t0000664000000000000000000002334314777226410021030 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/inline-table/inline-table.toml0000664000000000000000000000023514777226410021533 0ustar name = { first = "Tom", last = "Preston-Werner" } point = { x = 1, y = 2 } simple = { a = 1 } str-key = { "a" = 1 } table-array = [{ "a" = 1 }, { "b" = 2 }] work/TOML-Tiny/t/toml-test/valid/inline-table/key-dotted.t0000664000000000000000000007002614777226410020536 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/inline-table/key-dotted.toml0000664000000000000000000000046414777226410021245 0ustar 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} work/TOML-Tiny/t/toml-test/valid/inline-table/multiline.t0000664000000000000000000001037614777226410020471 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/inline-table/multiline.toml0000664000000000000000000000013014777226410021164 0ustar tbl_multiline = { a = 1, b = """ multiline """, c = """and yet another line""", d = 4 } work/TOML-Tiny/t/toml-test/valid/inline-table/nest.t0000664000000000000000000003024214777226410017432 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/inline-table/nest.toml0000664000000000000000000000056414777226410020146 0ustar 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 } ] ] work/TOML-Tiny/t/toml-test/valid/integer/0000775000000000000000000000000014777226410015365 5ustar work/TOML-Tiny/t/toml-test/valid/integer/integer.t0000664000000000000000000001354014777226410017212 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/integer/integer.toml0000664000000000000000000000006514777226410017720 0ustar answer = 42 posanswer = +42 neganswer = -42 zero = 0 work/TOML-Tiny/t/toml-test/valid/integer/literals.t0000664000000000000000000002636414777226410017404 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/integer/literals.toml0000664000000000000000000000022714777226410020102 0ustar bin1 = 0b11010110 bin2 = 0b1_0_1 oct1 = 0o01234567 oct2 = 0o755 oct3 = 0o7_6_5 hex1 = 0xDEADBEEF hex2 = 0xdeadbeef hex3 = 0xdead_beef hex4 = 0x00987 work/TOML-Tiny/t/toml-test/valid/integer/long.t0000664000000000000000000000734414777226410016521 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/integer/long.toml0000664000000000000000000000010514777226410017215 0ustar int64-max = 9223372036854775807 int64-max-neg = -9223372036854775808 work/TOML-Tiny/t/toml-test/valid/integer/underscore.t0000664000000000000000000000663514777226410017735 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/integer/underscore.toml0000664000000000000000000000003114777226410020425 0ustar kilo = 1_000 x = 1_1_1_1 work/TOML-Tiny/t/toml-test/valid/integer/zero.t0000664000000000000000000003407014777226410016535 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/integer/zero.toml0000664000000000000000000000017214777226410017241 0ustar d1 = 0 d2 = +0 d3 = -0 h1 = 0x0 h2 = 0x00 h3 = 0x00000 o1 = 0o0 a2 = 0o00 a3 = 0o00000 b1 = 0b0 b2 = 0b00 b3 = 0b00000 work/TOML-Tiny/t/toml-test/valid/key/0000775000000000000000000000000014777226410014520 5ustar work/TOML-Tiny/t/toml-test/valid/key/alphanum.t0000664000000000000000000001011014777226410016503 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/key/alphanum.toml0000664000000000000000000000025514777226410017224 0ustar 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 work/TOML-Tiny/t/toml-test/valid/key/case-sensitive.t0000664000000000000000000000344314777226410017633 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/key/case-sensitive.toml0000664000000000000000000000031314777226410020334 0ustar 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" work/TOML-Tiny/t/toml-test/valid/key/dotted.t0000664000000000000000000007027414777226410016202 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/key/dotted.toml0000664000000000000000000000102714777226410016700 0ustar # 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 work/TOML-Tiny/t/toml-test/valid/key/empty.t0000664000000000000000000000235214777226410016045 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/key/empty.toml0000664000000000000000000000001514777226410016547 0ustar "" = "blank" work/TOML-Tiny/t/toml-test/valid/key/equals-nospace.t0000664000000000000000000000457614777226410017641 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/key/equals-nospace.toml0000664000000000000000000000001214777226410020326 0ustar answer=42 work/TOML-Tiny/t/toml-test/valid/key/escapes.t0000664000000000000000000000311714777226410016332 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/key/escapes.toml0000664000000000000000000000022514777226410017037 0ustar "\n" = "newline" "\u00c0" = "latin capital letter A with grave" "\"" = "just a quote" ["backsp\b\b"] ["\"quoted\""] quote = true ["a.b"."\u00c0"] work/TOML-Tiny/t/toml-test/valid/key/numeric-dotted.t0000664000000000000000000000476014777226410017637 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/key/numeric-dotted.toml0000664000000000000000000000001014777226410020327 0ustar 1.2 = 3 work/TOML-Tiny/t/toml-test/valid/key/numeric.t0000664000000000000000000000441314777226410016351 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/key/numeric.toml0000664000000000000000000000000614777226410017053 0ustar 1 = 1 work/TOML-Tiny/t/toml-test/valid/key/quoted-dots.t0000664000000000000000000002370414777226410017163 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/key/quoted-dots.toml0000664000000000000000000000016014777226410017662 0ustar plain = 1 "with.dot" = 2 [plain_table] plain = 3 "with.dot" = 4 [table.withdot] plain = 5 "key.with.dots" = 6 work/TOML-Tiny/t/toml-test/valid/key/space.t0000664000000000000000000000444514777226410016007 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/key/space.toml0000664000000000000000000000001214777226410016501 0ustar "a b" = 1 work/TOML-Tiny/t/toml-test/valid/key/special-chars.t0000664000000000000000000000560714777226410017433 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/key/special-chars.toml0000664000000000000000000000005214777226410020130 0ustar "~!@$^&*()_+-`1234567890[]|/?><.,;:'" = 1 work/TOML-Tiny/t/toml-test/valid/key/special-word.t0000664000000000000000000000701414777226410017300 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/key/special-word.toml0000664000000000000000000000011114777226410017777 0ustar false = false true = 1 inf = 100000000 nan = "ceci n'est pas un nombre" work/TOML-Tiny/t/toml-test/valid/newline-crlf.t0000664000000000000000000000243214777226410016503 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/newline-crlf.toml0000664000000000000000000000003614777226410017211 0ustar os = "DOS" newline = "crlf" work/TOML-Tiny/t/toml-test/valid/newline-lf.t0000664000000000000000000000242114777226410016154 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/newline-lf.toml0000664000000000000000000000003314777226410016661 0ustar os = "unix" newline = "lf" work/TOML-Tiny/t/toml-test/valid/spec-example-1-compact.t0000664000000000000000000002667414777226410020301 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/spec-example-1-compact.toml0000664000000000000000000000057014777226410020774 0ustar #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" ] work/TOML-Tiny/t/toml-test/valid/spec-example-1.t0000664000000000000000000002663414777226410016651 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/spec-example-1.toml0000664000000000000000000000105714777226410017351 0ustar # 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" ] work/TOML-Tiny/t/toml-test/valid/string/0000775000000000000000000000000014777226410015236 5ustar work/TOML-Tiny/t/toml-test/valid/string/double-quote-escape.t0000664000000000000000000000246414777226410021274 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/string/double-quote-escape.toml0000664000000000000000000000002114777226410021767 0ustar test = "\"one\"" work/TOML-Tiny/t/toml-test/valid/string/empty.t0000664000000000000000000000236714777226410016571 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/string/empty.toml0000664000000000000000000000001414777226410017264 0ustar answer = "" work/TOML-Tiny/t/toml-test/valid/string/escape-tricky.t0000664000000000000000000000326014777226410020167 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/string/escape-tricky.toml0000664000000000000000000000051014777226410020672 0ustar 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\''' work/TOML-Tiny/t/toml-test/valid/string/escaped-escape.t0000664000000000000000000000244014777226410020265 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/string/escaped-escape.toml0000664000000000000000000000002114777226410020766 0ustar answer = "\\x64" work/TOML-Tiny/t/toml-test/valid/string/escapes.t0000664000000000000000000000431414777226410017050 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/string/escapes.toml0000664000000000000000000000140314777226410017554 0ustar 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." work/TOML-Tiny/t/toml-test/valid/string/multiline-quotes.t0000664000000000000000000000333514777226410020747 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/string/multiline-quotes.toml0000664000000000000000000000070014777226410021450 0ustar # 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''' work/TOML-Tiny/t/toml-test/valid/string/nl.t0000664000000000000000000000263014777226410016035 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/string/nl.toml0000664000000000000000000000016314777226410016544 0ustar nl_mid = "val\nue" nl_end = """value\n""" lit_nl_end = '''value\n''' lit_nl_mid = 'val\nue' lit_nl_uni = 'val\ue' work/TOML-Tiny/t/toml-test/valid/string/raw-multiline.t0000664000000000000000000000275214777226410020222 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/string/raw-multiline.toml0000664000000000000000000000030314777226410020720 0ustar 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.''' work/TOML-Tiny/t/toml-test/valid/string/raw.t0000664000000000000000000000332214777226410016214 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/string/raw.toml0000664000000000000000000000056514777226410016732 0ustar 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.' work/TOML-Tiny/t/toml-test/valid/string/simple.t0000664000000000000000000000243614777226410016721 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/string/simple.toml0000664000000000000000000000005714777226410017426 0ustar answer = "You are not drinking enough whisky." work/TOML-Tiny/t/toml-test/valid/string/unicode-escape.t0000664000000000000000000000251214777226410020307 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/string/unicode-escape.toml0000664000000000000000000000005214777226410021014 0ustar answer4 = "\u03B4" answer8 = "\U000003B4" work/TOML-Tiny/t/toml-test/valid/string/unicode-literal.t0000664000000000000000000000244614777226410020511 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/string/unicode-literal.toml0000664000000000000000000000001614777226410021210 0ustar answer = "δ" work/TOML-Tiny/t/toml-test/valid/string/with-pound.t0000664000000000000000000000255414777226410017527 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/string/with-pound.toml0000664000000000000000000000016114777226410020227 0ustar pound = "We see no # comments here." poundcomment = "But there are # some comments here." # Did I # mess you up? work/TOML-Tiny/t/toml-test/valid/table/0000775000000000000000000000000014777226410015017 5ustar work/TOML-Tiny/t/toml-test/valid/table/array-implicit.t0000664000000000000000000000304214777226410020131 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/table/array-implicit.toml0000664000000000000000000000004514777226410020641 0ustar [[albums.songs]] name = "Glory Days" work/TOML-Tiny/t/toml-test/valid/table/array-many.t0000664000000000000000000000345614777226410017274 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/table/array-many.toml0000664000000000000000000000024314777226410017773 0ustar [[people]] first_name = "Bruce" last_name = "Springsteen" [[people]] first_name = "Eric" last_name = "Clapton" [[people]] first_name = "Bob" last_name = "Seger" work/TOML-Tiny/t/toml-test/valid/table/array-nest.t0000664000000000000000000000454114777226410017275 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/table/array-nest.toml0000664000000000000000000000040614777226410020001 0ustar [[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" work/TOML-Tiny/t/toml-test/valid/table/array-one.t0000664000000000000000000000272114777226410017103 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/table/array-one.toml0000664000000000000000000000007214777226410017610 0ustar [[people]] first_name = "Bruce" last_name = "Springsteen" work/TOML-Tiny/t/toml-test/valid/table/array-table-array.t0000664000000000000000000000356414777226410020533 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/table/array-table-array.toml0000664000000000000000000000015414777226410021233 0ustar [[a]] [[a.b]] [a.b.c] d = "val0" [[a.b]] [a.b.c] d = "val1" work/TOML-Tiny/t/toml-test/valid/table/empty.t0000664000000000000000000000235614777226410016350 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/table/empty.toml0000664000000000000000000000000414777226410017044 0ustar [a] work/TOML-Tiny/t/toml-test/valid/table/keyword.t0000664000000000000000000000251714777226410016675 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/table/keyword.toml0000664000000000000000000000004014777226410017372 0ustar [true] [false] [inf] [nan] work/TOML-Tiny/t/toml-test/valid/table/names.t0000664000000000000000000000415314777226410016312 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/table/names.toml0000664000000000000000000000013214777226410017013 0ustar [a.b.c] [a."b.c"] [a.'d.e'] [a.' x '] [ d.e.f ] [ g . h . i ] [ j . "Êž" . 'l' ] [x.1.2] work/TOML-Tiny/t/toml-test/valid/table/no-eol.t0000664000000000000000000000236614777226410016404 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/table/no-eol.toml0000664000000000000000000000001014777226410017074 0ustar [table] work/TOML-Tiny/t/toml-test/valid/table/sub-empty.t0000664000000000000000000000246714777226410017142 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/table/sub-empty.toml0000664000000000000000000000001214777226410017632 0ustar [a] [a.b] work/TOML-Tiny/t/toml-test/valid/table/whitespace.t0000664000000000000000000000241214777226410017337 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/table/whitespace.toml0000664000000000000000000000001614777226410020045 0ustar ["valid key"] work/TOML-Tiny/t/toml-test/valid/table/with-literal-string.t0000664000000000000000000000617714777226410021130 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/table/with-literal-string.toml0000664000000000000000000000005114777226410021621 0ustar ['a'] [a.'"b"'] [a.'"b"'.c] answer = 42 work/TOML-Tiny/t/toml-test/valid/table/with-pound.t0000664000000000000000000000532714777226410017311 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/table/with-pound.toml0000664000000000000000000000003214777226410020005 0ustar ["key#group"] answer = 42 work/TOML-Tiny/t/toml-test/valid/table/with-single-quotes.t0000664000000000000000000000604714777226410020763 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/table/with-single-quotes.toml0000664000000000000000000000004514777226410021463 0ustar ['a'] [a.'b'] [a.'b'.c] answer = 42 work/TOML-Tiny/t/toml-test/valid/table/without-super.t0000664000000000000000000000275714777226410020056 0ustar # File automatically generated from BurntSushi/toml-test use utf8; use Test2::V0; use Data::Dumper; use Math::BigInt; use Math::BigFloat; use TOML::Tiny; local $Data::Dumper::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;work/TOML-Tiny/t/toml-test/valid/table/without-super.toml0000664000000000000000000000017014777226410020551 0ustar # [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 work/TOML-Tiny/t/writer.t0000664000000000000000000001063514777226410012407 0ustar 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" work/debian/0000775000000000000000000000000014777226410010164 5ustar work/debian/.gitignore0000664000000000000000000000012014777226410012145 0ustar files *-stamp nailing-cargo nailing-cargo.debhelper.log nailing-cargo.substvars work/debian/README.source0000664000000000000000000000051714777226410012346 0ustar nailing-cargo is maintained upstream on Salsa: https://salsa.debian.org/iwj/nailing-cargo The subdirectory TOML-Tiny is a fork of TOML-Tiny 0.06 from 2020, which currently still exists because of bugs which are still present in TOML-Tiny upstream 0.19. We are working on that. The TOML-Tiny directory is managed with git-subtree. work/debian/changelog0000664000000000000000000000611214777226410012036 0ustar nailing-cargo (1.1.2) unstable; urgency=medium * Set RUSTUP_AUTO_INSTALL along with CARGO_NET_OFFLINE. Improves behaviour with Rustup >= 1.28. Closes: #1103157. -- Ian Jackson Mon, 14 Apr 2025 16:43:04 +0100 nailing-cargo (1.1.1) unstable; urgency=medium * If Cargo.nail doesn't exist, treat it as empty, and adjust docs. Fixes gitlab nailing-cargo#4, nailing-cargo#14. [Sean Whitton] -- Ian Jackson Fri, 28 Mar 2025 16:47:06 +0000 nailing-cargo (1.1.0) unstable; urgency=medium Significant new features: * New --git mode, selected automatically if .git exists. * oot: Add support for sudo. [Sean Whitton] * New subdir option for running in a subdirectory of the tree. * New raw chdir option for changing directory. Other new features and improvements: * Add option for overriding Cargo.nail filename. * Pass NAILINGCARGO_TOOLCHAIN. * Support usual_toolchain in Cargo.nail. * Fix bugs with unborn branches; make cargo init work. * Set CARGO_NET_OFFLINE unless --online. * Recognise `cargo audit` subcommand. * Recognise abbreviated form of preclean option, --[no-]preclean[=...]. * Introduce pristine-git subcomd property and use it for publish. * Make build directory regardless of cargo lock update mode. Bugfixes: * Fix bugs in argument parser. * docs: Fix help message for --chdir=. * Don't assume that `git-*' are on the caller's path. [Mark Wooding] * Fix OOT with SSH, which was just broken. [Mark Wooding] * Arrange to git add Cargo.lock even when it's ignored. * Toolchain selection: fix subcmd detection. * Transfer -E output back even if command fails. * Always overwrite edit, so as to avoid trashing real working tree. * Improvements to messages (including fixing some warnings). * Cope with wider range of initial states. * Don't try to return files with -E if not out-of-tree build. * Improve interaction of -EE with linkfarming. * Bugfixes relating to unusual pathnames in the build tree. * Better handle Cargo.lock: fix if the build dir loses it. * Fix handling of root workspace member. Packaging and disstribution: * Updated embedded TOML::Tiny copy to upstream v0.20; that has the needed bug fixes (and corresponding tests). [Assistance with upstream from Sean Whitton] * In Debian binary package, no longer ship embedded TOML::Tiny; instead, Depend on, and use, the system package. (We will must ship TOML::Tiny::Faithful, which is not in TOML::Tiny at all, having been rejected by upstream.) * Declare this a native package, unifying upstream and Debian work. * CI: Use the Debian Salsa CI Team pipeline. * Upload to unstable, now the embedded code copy is gone from the .debs. -- Ian Jackson Wed, 26 Mar 2025 11:42:40 +0000 nailing-cargo (1.0.0+git20250110.3a8b82f2-1) experimental; urgency=medium * Initial upload to Debian. - Uploading to experimental while we figure out the TOML::Tiny situation. -- Ian Jackson Tue, 04 Mar 2025 01:11:18 +0000 work/debian/control0000664000000000000000000000210514777226410011565 0ustar Source: nailing-cargo Section: devel Priority: optional Maintainer: Ian Jackson Standards-Version: 4.7.2.0 Build-Depends: debhelper-compat (= 13) Vcs-Git: https://salsa.debian.org/iwj/nailing-cargo.git Vcs-Browser: https://salsa.debian.org/iwj/nailing-cargo Homepage: https://salsa.debian.org/iwj/nailing-cargo Package: nailing-cargo Depends: perl, libtypes-serialiser-perl, libtoml-tiny-perl (>= 0.20~), libdatetime-format-iso8601-perl, libdatetime-format-rfc3339-perl, ${misc:Depends} Architecture: all Description: privilege separation for Rust builds nailing-cargo allows you to run download and run the Rust toolchain and dependencies from crates.io, all as a separate user. . This can help limit the security impact of hostile or compromised crates. It is suitable for use with upstream tooling from rustup.rs. . It supports Debian-shipped cargo and rustc too. (But the combination of Debian toolchain and upstream dependencies is not the outcome of a sensible security posture, so is not recommended by this author.) work/debian/copyright0000664000000000000000000010724114777226410012124 0ustar Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: nailing-cargo Upstream-Contact: Ian Jackson Source: https://salsa.debian.org/iwj/nailing-cargo Files: * Copyright: 2019-2025 Ian Jackson 2020-2023 Mark Wooding 2024 Sean Whitton Comment: SPDX-License-Identifier: AGPL-3.0-or-later . Copyright (C) 2019 and later Ian Jackson and contributors . This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, 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 Affero General Public License for more details. . You should have received a copy of the GNU Affero General Public License along with this program. If not, see . License: AGPL-3+ This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Files: TOML-Tiny/* Copyright: 2020 Jeff Ober 2020,2024 Ian Jackson Comment: This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. License: GPL-1+ or Artistic The GPL version 1 can be found in /usr/share/common-licenses/GPL-1 and the Artistic Licence in /usr/share/common-licenses/Artistic. License: AGPL-3+ GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 . Copyright (C) 2007 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 GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. . The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program-- to make sure it remains free software for all its users. . When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), 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. . Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software. . A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public. . The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version. . An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license. . The precise terms and conditions for copying, distribution and modification follow. . TERMS AND CONDITIONS . 0. Definitions. . "This License" refers to version 3 of the GNU Affero General Public License. . "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. . "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. . To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. . A "covered work" means either the unmodified Program or a work based on the Program. . To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. . To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. . An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. . 1. Source Code. . The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. . A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. . The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. . The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. . The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. . The Corresponding Source for a work in source code form is that same work. . 2. Basic Permissions. . All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. . You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. . Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. . 3. Protecting Users' Legal Rights From Anti-Circumvention Law. . No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. . When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. . 4. Conveying Verbatim Copies. . You may convey 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; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. . You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. . 5. Conveying Modified Source Versions. . You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: . a) The work must carry prominent notices stating that you modified it, and giving a relevant date. . b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". . c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. . d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. . A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. . 6. Conveying Non-Source Forms. . You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: . a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. . b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. . c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. . d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. . e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. . A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. . A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. . "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. . If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). . The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. . Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. . 7. Additional Terms. . "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. . When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. . Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: . a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or . b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or . c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or . d) Limiting the use for publicity purposes of names of licensors or authors of the material; or . e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or . f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. . All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. . If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. . Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. . 8. Termination. . You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). . However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. . Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. . Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. . 9. Acceptance Not Required for Having Copies. . You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. . 10. Automatic Licensing of Downstream Recipients. . Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. . An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. . You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. . 11. Patents. . A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". . A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. . Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. . In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. . If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. . If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. . A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. . Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. . 12. No Surrender of Others' Freedom. . If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. . 13. Remote Network Interaction; Use with the GNU General Public License. . Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. . Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. . 14. Revised Versions of this License. . The Free Software Foundation may publish revised and/or new versions of the GNU Affero 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 that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. . If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. . Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. . 15. Disclaimer of Warranty. . 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. . 16. Limitation of Liability. . IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 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. . 17. Interpretation of Sections 15 and 16. . If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. . END OF TERMS AND CONDITIONS . 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 the public, 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 state 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) . This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, 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 Affero General Public License for more details. . You should have received a copy of the GNU Affero General Public License along with this program. If not, see . . Also add information on how to contact you by electronic and paper mail. . If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. . You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see . work/debian/dirs0000664000000000000000000000001014777226410011037 0ustar usr/bin work/debian/install0000664000000000000000000000024114777226410011552 0ustar nailing-cargo usr/share/nailing-cargo TOML-Tiny/lib//TOML/Tiny/Faithful.pm usr/share/nailing-cargo/TOML-Tiny/lib/TOML/Tiny README.md usr/share/doc/nailing-cargo work/debian/links0000664000000000000000000000011014777226410011217 0ustar usr/share/doc/nailing-cargo/README.md usr/share/nailing-cargo/README.md work/debian/rules0000775000000000000000000000076614777226410011255 0ustar #! /usr/bin/make -f %: dh "$@" # nailing-cargo expects to find its TOML::Tiny fork, and README.md via $0. # This is pretty nasty, but we hope to get rid of the fork entirely, # which will make the TOML::Tinyh part redundant. This works and will do. execute_after_dh_install: install -m755 debian/wrapper debian/nailing-cargo/usr/bin/nailing-cargo # nailing-cargo's --doc option doesn't work with a compressed README # The file is only 12k, anyway. override_dh_compress: dh_compress -X README.md work/debian/source/0000775000000000000000000000000014777226410011464 5ustar work/debian/source/format0000664000000000000000000000000414777226410012671 0ustar 1.0 work/debian/source.lintian-overrides0000664000000000000000000000021214777226410015037 0ustar # lintian hates non-native versions with native packaging, # even though this is fine (by TC decision) malformed-debian-changelog-version work/debian/tests/0000775000000000000000000000000014777226410011326 5ustar work/debian/tests/basic0000775000000000000000000000025414777226410012336 0ustar #!/bin/bash set -e cd "$AUTOPKGTEST_TMP" HOME=$(pwd) touch Cargo.nail mkdir x cd x nailing-cargo -EE init --vcs none pkg mv pkg .. cd ../pkg find -ls nailing-cargo -u run work/debian/tests/control0000664000000000000000000000010114777226410012721 0ustar Tests: basic Depends: @, cargo, rustc Restrictions: allow-stderr work/debian/wrapper0000775000000000000000000000010214777226410011563 0ustar #!/bin/sh set -e exec /usr/share/nailing-cargo/nailing-cargo "$@" work/markdown-toc-filter0000775000000000000000000000127214777226410012562 0ustar #!/usr/bin/perl -wn use strict; use autodie; our (@doc, @toc); our $last; sub scanline () { if (m/^-+$/ || m/^=+$/) { my $lev = $& =~ m/^=/ ? ' ' : ' '; my $href = $last; $href =~ y/ A-Z/-a-z/; $href =~ y/-._a-z//cd; my $text = $last; $text = 'Introduction' if $. == 2; push @toc, "${lev}* [$text](#$href)\n"; } $last = $_; chomp $last; } if (1..(m/^[A-Z]/ && m/table of contents/i)) { # before TOC scanline(); print; } elsif (m/^\w/..0) { # after TOC push @doc, $_; scanline(); } else { # in TOC print if m/^===|^---/; scanline(); } END { print < END print @doc; } work/nailing-cargo0000775000000000000000000013043214777226410011405 0ustar #!/usr/bin/perl -w # nailing-cargo: wrapper to use unpublished local crates # SPDX-License-Identifier: AGPL-3.0-or-later our $usage = <<'END'; usages: nailing-cargo [--] ... nailing-cargo --- [--] ... nailing-cargo --- [--] ... options: -v Increase verbosity. (Default is 1) -q Set verbosity to 0 -D Increase amount of debugging dump. -n "No action": stop after writing Cargo.toml.nailing~ everywhere, and do not run any build command -c Do add cargo command line options } default is add if -C Do not add cargo command line options } command is cargo -o --online -O --offline -u --cargo-lock-update -U --no-cargo-lock-update -T --target= Specify target architecture -h --help Print this message --doc --man --manual Display complete manual (in w3m) --leave-nailed Leave the nailed Cargo.toml in place -E | --edits-sources Allow source edits (repeat: file creation) -f | --force Override some warnings --linkfarm[=no|shallow|git|full] (default varies, usually "no") --[no-]git Instead of linkfarming, use git --just-linkfarm | --clean-linkfarm | --keep-linkfarm (default is keep) --just-git Implies --git, only does the update --[no-]preclean[=no|src|full] (default is no) --just-run Run the command, don't do cargo/git stuff --subdir=DIR Relative cd, right at the beginning --chdir=DIR Relative cd, just before running command --no-nail Do not nail, just run the command. --no-cargo-lock-manip Do not manipulate Cargo.lock. --no-concurrency-lock Do not take the concurrency lock. -s Treat command as `cargo ` --subcommand-props=,... Override command props (see docs) END our $self; use strict; use POSIX; use Types::Serialiser; use File::Glob qw(bsd_glob GLOB_ERR GLOB_BRACE GLOB_NOMAGIC); use Cwd qw(realpath); our $base_path; our %archmap = ( RPI => 'arm-unknown-linux-gnueabihf', WASM => 'wasm32-unknown-unknown', ); BEGIN { $self = $0; $self =~ s{^.*/(?=.)}{}; my $deref = $0; our $base_path; while ($deref =~ m{^/}) { my $link = readlink $deref; if (!defined $link) { $! == EINVAL or die "$self: checking our script location $deref: $!\n"; $deref =~ s{/[^/]+$}{} or die "$self: unexpected script path: $deref\n"; $base_path = $deref; unshift @INC, $deref."/TOML-Tiny/lib"; last; } last if $link !~ m{^/}; $deref = $link; } } use Fcntl qw(LOCK_EX); use File::Compare; use TOML::Tiny::Faithful; our ($src_absdir, $worksphere, $subdir); our $lockfile = "../.nailing-cargo.lock"; our $nailfile = "../Cargo.nail"; our @args_preface; our $arg_toolchain; our $cargo_subcmd; our $command_is_cargo; our $alt_cargo_lock; our $cargo_lock_update; our $pass_options; our $online; our $just_linkfarm; our $edits_sources=0; our $leave_nailed; our $oot_clean; our $oot_preclean; our $do_nail=1; our $do_cargo_lock=1; our $do_lock=1; our $linkfarm_depth; # ignored if $gitxfer our $chdir=undef; our $clisubdir=''; our $gitxfer; # --git (not the same as --linkfarm=git, see docs) # our %subcmd_props = ( # build (default) =>[qw( )], audit =>[qw( !locked linkfarm-shallow )], fetch =>[qw( online !target-dir )], fmt =>[qw( !locked !target !offline !target-dir edits )], 'generate-lockfile'=>[qw( lock-update !target !target-dir )], init =>[qw( creates )], metadata =>[qw( !target-dir )], miri =>[qw( !locked !offline linkfarm-shallow )], publish =>[qw( !offline pristine-git )], update =>[qw( lock-update !target online )], upgrades =>[qw( !locked !target-dir )], ); our @subcmd_xprops = qw(!manifest-path); our @configs; our $verbose=1; our $force=0; our $forced=0; our ($noact,$dump); our $target; sub print_usage () { print $usage or die $!; exit 0; } sub show_manual () { my $manual = ($base_path // '.').'/README.md'; stat $manual or die "$self: manual not found at $manual: $!\n";; exec 'sh','-ec', 'pandoc -- "$1" 2>&1 | w3m -T text/html', '--', $manual; die "$self: exec sh failed: $!"; } sub forceable_warning ($) { my ($m) = @_; print STDERR "$self: *WARNING*: $m\n"; if ($force) { print STDERR "$self: continuing because of --force...\n" unless $forced++; return; } else { die "$self: Stopping due to warning (override with -f | --force)\n"; } } sub shell_quotify (@) { return join ' ', map { if (m/\W/) { s/\'/\'\\'\'/g; $_ = "'$_'"; } $_ } @_; } sub read_or_enoent ($) { my ($fn) = @_; if (!open R, '<', $fn) { return undef if $!==ENOENT; die "$self: open $fn: $!\n"; } local ($/) = undef; my ($r) = // die "$self: read $fn: $!\n"; $r; } sub stat_exists ($$) { my ($fn, $what) = @_; if (stat $fn) { return 1; } $!==ENOENT or die "$self: stat $what: $fn: $!\n"; return 0; } sub subcmd_p ($) { print STDERR " subcmd_p ".(join ' ', keys %$cargo_subcmd)." | @_\n" if $dump; $cargo_subcmd->{$_[0]} } sub toml_or_enoent ($$) { my ($f,$what) = @_; my $toml = read_or_enoent($f) // return; print STDERR "Read TOML from $f\n" if $dump; my ($v,$e) = from_toml($toml); if (!defined $v) { chomp $e; die "$self: parse TOML: $what: $f: $e\n"; } die "$e ?" if length $e; $v; } sub load1config ($) { my ($f) = @_; my $toml = toml_or_enoent($f, "config file"); push @configs, $toml if defined $toml; } sub loadconfigs () { my $dotfile = ".nailing-cargo.toml"; load1config("../Nailing-Cargo.toml"); load1config($dotfile); load1config("$ENV{HOME}/$dotfile") if defined $ENV{HOME}; load1config("/etc/nailing-cargo/cfg.toml"); } sub unlink_or_enoent ($) { unlink $_[0] or $!==ENOENT; } sub same_file ($$) { my ($x,$y) = @_; "@$x[0..5]" eq "@$y[0..5]"; } sub takelock () { return unless $do_lock; for (;;) { open LOCK, ">", $lockfile or die "$self: open/create $lockfile: $!\n"; flock LOCK, LOCK_EX or die "$self: lock $lockfile: $!\n"; my @fstat = stat LOCK or die "$self: fstat: $!\n"; my @stat = stat $lockfile; if (!@stat) { next if $! == ENOENT; die "$self: stat $lockfile: $!\n"; } last if same_file(\@fstat,\@stat); } } sub unlock () { unlink $lockfile or die "$self: removing lockfile: $!\n"; } our $nail; sub badcfg { my $m = pop @_; $" = '.'; die "$self: config key \`@_': $m\n"; } sub cfg_uc { foreach my $cfg (@configs) { my $v = $cfg; foreach my $k (@_) { last unless defined $v; ref($v) eq 'HASH' or badcfg @_, "parent key \`$k' is not a hash"; $v = $v->{$k}; } return $v if defined $v; } return undef; } sub cfge { my $exp = shift @_; my $v = cfg_uc @_; my $got = ref($v) || 'scalar'; return $v if !defined($v) || $got eq $exp; badcfg @_, "found \L$got\E, expected \L$exp\E"; # ^ toml doesn't make refs to scalars, so this is unambiguous } sub cfgn { my $exp = shift @_; (cfge $exp, @_) // badcfg @_, "missing"; } sub cfgs { cfge 'scalar', @_ } sub cfgsn { cfgn 'scalar', @_ } sub cfg_bool { my $v = cfg_uc @_; return $v if !defined($v) || Types::Serialiser::is_bool $v; badcfg @_, "expected boolean"; } sub cfgn_list { my $l = cfge 'ARRAY', @_; foreach my $x (@$l) { !ref $x or badcfg @_, "list contains non-scalar element"; } @$l } sub readnail () { if (open N, '<', $nailfile) { local ($/) = undef; my $toml = // die "$self: read $nailfile: $!"; my $transformed; if ($toml !~ m{^\s*\[/}m && $toml !~ m{^[^\n\#]*\=}m && # old non-toml syntax $toml =~ s{^[ \t]*([-_0-9a-z]+)[ \t]+(\S+)[ \t]*$}{$1 = \"$2\"}mig) { $toml =~ s{^}{[packages\]\n}; my @sd; $toml =~ s{^[ \t]*\-[ \t]*\=[ \t]*(\"[-_0-9a-z]+\"\n?)$}{ push @sd, $1; ''; }mige; $toml = "subdirs = [\n".(join '', map { "$_\n" } @sd)."]\n".$toml; $transformed = 1; } my $e; ($nail,$e) = from_toml($toml); if (!defined $nail) { if ($transformed) { $toml =~ s/^/ /mg; print STDERR "$self: $nailfile transformed into TOML:\n$toml\n"; } $/="\n"; chomp $e; die "$self: parse $nailfile: $e\n"; } die "$e ?" if length $e; } elsif ($! != ENOENT) { die "$self: open $nailfile: $!\n"; } $nail->{subdirs} //= [ ]; if (!ref $nail->{subdirs}) { $nail->{subdirs} = [ grep /^[^\#]/, map { s/^\s+//; s/\s+$//; $_; } split m{\n}, $nail->{subdirs} ]; } unshift @configs, $nail; } sub get_dependency_tables ($) { my ($toml) = @_; my @keys = qw(dependencies build-dependencies dev-dependencies); my @r; my $process = sub { my ($node) = @_; foreach my $k (@keys) { my $deps = $node->{$k}; push @r, $deps if $deps; } }; $process->($toml); foreach my $target_node (values %{ $toml->{target} // { } }) { $process->($target_node); } @r; } our @alt_cargo_lock_stat; sub consider_alt_cargo_lock () { my @ck = qw(alt_cargo_lock); # User should *either* have Cargo.lock in .gitignore, # or expect to commit Cargo.lock.example ($alt_cargo_lock) return unless $do_cargo_lock; $alt_cargo_lock = (cfg_uc @ck); my $force = 0; if (defined($alt_cargo_lock) && ref($alt_cargo_lock) eq 'HASH') { $force = cfg_bool qw(alt_cargo_lock force); my @ck = qw(alt_cargo_lock file); $alt_cargo_lock = cfg_uc @ck; } $alt_cargo_lock //= Types::Serialiser::true; if (Types::Serialiser::is_bool $alt_cargo_lock) { if (!$alt_cargo_lock) { $alt_cargo_lock = undef; return; } $alt_cargo_lock = 'Cargo.lock.example'; } if (ref($alt_cargo_lock) || $alt_cargo_lock =~ m{/}) { badcfg @ck, "expected boolean, or leafname"; } my $check = $alt_cargo_lock; $check = "$chdir/$check" if length $chdir; if (!stat_exists $check, "alt_cargo_lock") { $alt_cargo_lock = undef unless $force; return; } @alt_cargo_lock_stat = stat _; } our $oot_dir; # oot.dir or "Build" our $oot_absdir; sub consider_oot () { $oot_dir = cfgs qw(oot dir); my $use = cfgs qw(oot use); unless (defined($oot_dir) || defined($use) || defined(cfg_uc qw(oot user))) { return; } if (($use//'') eq 'disable') { $oot_dir = undef; return; } # OOT $oot_clean //= cfg_bool qw(oot clean); $oot_dir //= 'Build'; $oot_absdir = ($oot_dir !~ m{^/} ? "$worksphere/" : ""). $oot_dir; if (subcmd_p('pristine-git')) { $gitxfer = 1 if stat_exists('.git', 'source .git directory'); $oot_preclean //= 'full'; } } our %manifests; our %packagemap; our %workspaces; our @queued_paths; sub read_manifest ($$$) { my ($subdir, $org_subdir, $why) = @_; my $manifest = "../$subdir/Cargo.toml"; print STDERR "$self: reading $manifest...\n" if $verbose>=4; if (defined $manifests{$manifest}) { print STDERR "$self: warning: $subdir: specified more than once!". " (ignoring $why)\n"; return undef; } foreach my $try ("$manifest.unnailed", "$manifest") { my $toml = toml_or_enoent($try, "manifest, in $why") // next; my $ws = $toml->{workspace}; if ($ws) { queue_workspace_members($subdir, $org_subdir, $ws, "$subdir, $why"); } my $p = $toml->{package}{name}; if (!defined $p and !defined $ws) { print STDERR "$self: warning: $subdir, $why: missing package.name in $try, ignoring\n"; next; } $manifests{$manifest} = [ $toml, $org_subdir ] if $p; foreach my $dep (get_dependency_tables $toml) { next unless defined $dep->{path}; queue_referenced_path($dep->{path}, $org_subdir, "dependency of $subdir, $why"); } return ($p, $ws); } return undef; } sub queue_workspace_members ($$) { my ($subdir, $org_subdir, $ws_toml, $what) = @_; # We need to (more or less) reimplement the cargo workspace # membership algorithm (see the "workspaces" section of the cargo # reference). How tiresome. # # It's not quite the same for us because we aren't interested in # whether cargo thinks things are "in the workspace". But we do # need to do the automatic discover. my @include = @{ $ws_toml->{members} // [ ] }; my $exclude = $ws_toml->{exclude} // [ ]; my @exclude = map { s/[^*?0-9a-zA-Z_]/\\$&/g; s/\?/./g; s/\*/.*/g; } @$exclude; foreach my $spec (@include) { if ($spec =~ m{^/}) { print STDERR "$self: warning: absolute workspace member $spec in $what (not nailing, but cargo will probably use it)\n"; next; } my $spec_glob_prefix = "../$subdir/"; my $spec_glob = "$spec_glob_prefix$spec"; my $globflags = GLOB_ERR|GLOB_BRACE|GLOB_NOMAGIC; foreach my $globent (bsd_glob($spec_glob, $globflags)) { my $ent_prefix = substr($globent, 0, length $spec_glob_prefix); if ($ent_prefix ne $spec_glob_prefix) { print STDERR "$self: warning: $globent ($spec_glob, $what) points outside $spec_glob_prefix, not following so not nailing (although cargo probably will follow it)\n"; next; } next if grep { $globent =~ m{^$_$} } @exclude; queue_referenced_path($globent, $org_subdir, "member of workspace $what"); } } } sub queue_referenced_path ($$$) { my ($spec_path, $org_subdir, $why) = @_; open REALPATH, "-|", qw(realpath), "--relative-to=../$org_subdir", "--", $spec_path or die "$self: fork/pipe/exec for realpath(1)\n"; my $rel_path = do { local $/=undef; ; }; $?=0; $!=0; my $r = close(REALPATH); die "$self: reap realpath: $!\n" if $!; if (!chomp($rel_path) or $?) { print STDERR "$self: warning: failed to determine realpath for $spec_path in $org_subdir (exit code $?)\n"; return; } my $q_subdir = "$org_subdir/$rel_path"; print STDERR "$self: making a note to look at $q_subdir, $why)\n" if $verbose >= 4; push @queued_paths, [ "$q_subdir", $org_subdir, $why ]; } sub readorigs () { # We (and our callees) populate %packagemap and %manifest, so if we # don't run, they remain empty and nothing is nailed. return unless $do_nail; foreach my $p (keys %{ $nail->{packages} }) { my $v = $nail->{packages}{$p}; my $subdir = ref($v) ? $v->{subdir} : $v; my ($gotpackage, $ws) = read_manifest($subdir, $subdir, "from [packages]"); $gotpackage //= ''; if ($gotpackage ne $p) { print STDERR "$self: warning: honouring Cargo.nail packages.$subdir=$p even though $subdir contains package $gotpackage!\n"; } die if defined $packagemap{$p}; $packagemap{$p} = [ $subdir, $subdir ]; } foreach my $subdir (@{ $nail->{subdirs} }) { my ($gotpackage,$ws) = read_manifest($subdir, $subdir, "from [subdirs]"); if (!defined $gotpackage) { print STDERR "$self: warning: ignoring subdir $subdir which has no (suitable) Cargo.toml\n" unless $ws; next; } $packagemap{$gotpackage} //= [ $subdir, $subdir ]; } while (my ($subdir, $org_subdir, $why) = @{ shift @queued_paths or [] }) { $subdir =~ s{/\.$}{}; next if $manifests{"../$subdir/Cargo.toml"}; my ($gotpackage, $ws) = read_manifest($subdir, $org_subdir, $why); next unless $gotpackage; $packagemap{$gotpackage} //= [ $subdir, $org_subdir ]; } } sub calculate () { foreach my $p (sort keys %packagemap) { print STDERR "$self: package $p in $packagemap{$p}[0]\n" if $verbose>=2; } foreach my $mf (keys %manifests) { die "internal error" unless $do_nail; # belt and braces my ($toml, $mf_org_subdir) = @{ $manifests{$mf} }; foreach my $deps (get_dependency_tables $toml) { next unless $deps; foreach my $dep_key (keys %$deps) { my $info = $deps->{$dep_key}; my $p = (ref $info ? $info->{package} : undef) // $dep_key; next unless defined $packagemap{$p}; next if $packagemap{$p}[1] eq $mf_org_subdir; $deps->{$dep_key} = $info = { } unless ref $info; # was just version my $oldpath = $info->{path}; delete $info->{version}; my $newpath = $worksphere.'/'.$packagemap{$p}[0]; print STDERR "in $mf set $p path=$newpath (was ". ($oldpath // '').")\n" if $verbose >= 4; $info->{path} = $newpath; delete $info->{git}; delete $info->{branch}; } } my $nailing = "$mf.nailing~"; unlink_or_enoent $nailing or die "$self: remove old $nailing: $!\n"; open N, '>', $nailing or die "$self: create new $nailing: $!\n"; print N to_toml($toml) or die "$self: write new $nailing: $!\n"; close N or die "$self: close new $nailing: $!\n"; } } sub addargs () { # TODO $gitxfer support! if ($edits_sources==1) { $linkfarm_depth = 'copy-edit'; } elsif ($edits_sources>=2) { $linkfarm_depth = 'copy-edit-all'; } if ($just_linkfarm) { die "$self: --just-linkfarm but not doing out-of-tree builds!\n" unless defined $oot_dir; @ARGV = (); return; } if (!defined $online) { $_ = cfg_uc qw(misc online); if (!defined $_) { } elsif (Types::Serialiser::is_bool $_) { $online = $_; } elsif (ref $_) { } elsif (m/^a/) { $online = undef; } elsif (m/^[1ty]/) { # allow booleanish strings $online = 1; # for less user frustration } elsif (m/^[0fn]/) { $online = 0; } else { badcfg qw(misc online), "expected boolean or 'auto', found '$_'"; } } $online //= 1 if subcmd_p('online'); $online //= 0; if ($edits_sources>=2) { $oot_preclean //= 'src'; if ($oot_preclean !~ m/^(?:src|full)$/) { forceable_warning "-EE specified, but also --preclean=no; will probably leave your source tree full of junk"; } } if (subcmd_p('linkfarm-gitclean')) { $linkfarm_depth //= 'git'; $oot_preclean //= 'src'; } $cargo_lock_update //= subcmd_p('lock-update'); $linkfarm_depth //= subcmd_p('pristine-git') ? 'git' : subcmd_p('linkfarm-shallow') ? 'shallow' : $cargo_lock_update ? 'shallow' : ''; $oot_preclean //= $gitxfer ? 'src' : 'no'; my $toolchain = cfgs qw(misc usual_toolchain); $toolchain =~ s{^\+}{} if defined $toolchain; @args_preface = map { $_ ne "\0+" ? $_ : defined $toolchain ? "+$toolchain" : () } @args_preface; print STDERR "toolchain ".($toolchain // '')." \n" if $dump; if (defined $toolchain) { $ENV{NAILINGCARGO_TOOLCHAIN} = "+$toolchain"; } elsif (defined $arg_toolchain) { $ENV{NAILINGCARGO_TOOLCHAIN} = $arg_toolchain; } our @add; if (!$cargo_lock_update) { push @add, qw(--locked) unless subcmd_p('!locked'); } if ($linkfarm_depth eq '' && !$gitxfer) { if (defined($oot_dir) && !subcmd_p('!manifest-path')) { my $cargotoml = "${src_absdir}/Cargo.toml"; push @args_preface, "--manifest-path=$cargotoml" if $pass_options; push @add, qw(--target-dir=target) unless subcmd_p('!target-dir'); } } if (defined($target) && !subcmd_p('!target')) { if ($target =~ m{^[A-Z]}) { $target = (cfgs 'arch', $target) // $archmap{$target} // die "$self: --target=$target alias specified; not in cfg or map\n"; } push @add, "--target=$target"; } push @add, "--offline" unless $online || subcmd_p('!offline'); if (subcmd_p('creates') && $edits_sources < 2) { forceable_warning "this subcommand expects to create new source files; you probably want to specify --edits-sources twice aka -EE (which is not the default even now, for safety reasons)"; } elsif (subcmd_p('edits') && !$edits_sources) { forceable_warning "this subcommand expects to edit the source code; you probably want to specify --edits-sources aka -E (which is not the default even now, for safety reasons)"; } push @args_preface, @add if $pass_options; die if grep { m/ / } @add; $ENV{NAILINGCARGO_CARGO_OPTIONS} = "@add"; unshift @ARGV, @args_preface; } our $build_absdir; # .../Build/ sub oot_massage_cmdline () { return unless defined $oot_dir; my $use = cfgs qw(oot use); $use // die "$self: out-of-tree build, but \`oot.use' not configured\n"; $build_absdir = "$oot_absdir/$subdir"; my ($pre,$post) = ('',''); my @xargs; $pre .= "set -x;" if $dump; my $std_pre = sub { push @xargs, $oot_absdir, $subdir, $src_absdir; $pre .= <<'END_BOTH'; bld="$1"; shift; sd="$1"; shift; src="$1"; shift; cd "$bld"; mkdir -p -- "$sd"; cd "$sd"; END_BOTH }; if ($gitxfer) { $std_pre->(); $pre .= <<'END_GIT_XFER_PREP'; if test -d .git; then :; else git init; fi; mkdir -p .git/nailing-cargo .git/logs/refs/nailing-cargo; >>.git/logs/refs/nailing-cargo/src; parent_exists=$(set -e; cd "$src/"; git rev-parse --verify -q HEAD~0 || test $? = 1); if [ "$parent_exists" ]; then git fetch "$src" +HEAD:refs/nailing-cargo/src; fi; branch_exists=$(git rev-parse --verify -q HEAD~0 || test $? = 1); if [ "$branch_exists" ]; then git checkout --quiet --detach; fi; END_GIT_XFER_PREP if ($oot_preclean ne 'no') { $pre.= "git clean -xdf". ( $oot_preclean =~ /full/ ? '' : ' -e/target'. ( $clisubdir ne '' ? " -e/".(shell_quotify "$clisubdir")."target" : '' ) ). ';'; } $pre.= "git reset -q --hard;"; $pre .= <<'END_GIT_XFER_MKTREE'; if [ "$parent_exists" ]; then git checkout --quiet refs/nailing-cargo/src~0 --; fi; cp .git/index .git/nailing-cargo/index; exec 3>&1; exec >.git/nailing-cargo/commit; printf 'tree '; (set -e; cd "$src"; GIT_DIR="$bld/$sd"/.git; GIT_INDEX_FILE="$GIT_DIR/nailing-cargo/index"; export GIT_DIR GIT_INDEX_FILE; git add . >&2; if test -f Cargo.lock; then git add -f Cargo.lock >&2; fi; git write-tree); read <.git/nailing-cargo/commit our_tree; if [ "$parent_exists" ]; then their_tree=$(git cat-file commit refs/nailing-cargo/src | sed 1q); fi; if [ "x$our_tree" = "x$their_tree" ]; then git checkout --quiet refs/nailing-cargo/src --; else END_GIT_XFER_MKTREE if (subcmd_p('pristine-git')) { $pre .= <<'END_GIT_XFER_CLEAN'; echo >&2 '*** original source working tree is dirty - refusing! ***'; exit 12; END_GIT_XFER_CLEAN } else { $pre .= <<'END_GIT_XFER_DIRTY'; if [ "$parent_exists" ]; then printf 'parent '; git rev-parse HEAD~0; fi; authline=$(date +'nailing-cargo %s %z'); printf "author %s\ncommitter %s\n\nnailing-cargo autocommit dirty working tree\n" "$authline" "$authline"; obj=$(git hash-object -t commit -w .git/nailing-cargo/commit); exec >&2; git checkout --quiet "$obj"; END_GIT_XFER_DIRTY } $pre .= <<'END_GIT_XFER'; fi; exec >&3; END_GIT_XFER if ($edits_sources) { $pre .= <<'END_GIT_XFER_EDITS_CLEANUP'; git update-ref refs/nailing-cargo/edited HEAD~0:; END_GIT_XFER_EDITS_CLEANUP $post .= ':;'; # forces us to not use exec $pre .= <<'END_GIT_XFER_EDITS_CAPTURE'; trap ' rc=$?; git add -A .; tree=$(git write-tree); git update-ref refs/nailing-cargo/edited $tree; exit $rc; ' 0; END_GIT_XFER_EDITS_CAPTURE } } elsif ($linkfarm_depth eq '') { push @xargs, $build_absdir; $pre .= 'cd "$1"; shift; '; $post .= ''; } else { # not $gitxfer, some $linkfarm_depth $std_pre->(); if ($oot_preclean ne 'no') { $pre.= "find . -maxdepth 1 ! -path ."; $pre.= " ! -path ./target" if $oot_preclean ne 'full'; $pre.= " -print0 | xargs -0r rm -r --;" } if ($linkfarm_depth eq 'shallow') { $pre.= <<'END_SHALLOW'; clean () { find -lname "$src/*" -print0 | xargs -0r rm --; }; clean; find "$src" -maxdepth 1 \! -name Cargo.lock -print0 | xargs -0r sh -ec 'for f in "$@"; do rm -rf -- "${f##*/}"; ln -sf -- "$f" .; done'; END_SHALLOW } elsif ($linkfarm_depth =~ /full|git/) { $pre .= <<'END_EITHER_DEEP_DIRS'; clean () { find -follow -lname "$src/*" -print0 | xargs -0r rm --; }; (set -e; cd "$src"; find . \! -name Cargo.lock \! \( -name .git -prune \) \! -path . \! -name .git -type d -print0) | xargs -0r sh -ec 'for f in "$@"; do rm -f -- "$f" 2>/dev/null ||:; mkdir -p "$f"; done' x; END_EITHER_DEEP_DIRS if ($linkfarm_depth eq 'git') { $pre .= <<'END_FILES_GIT' (set -e; cd "$src"; git ls-files --exclude-standard -co -z) | END_FILES_GIT } elsif ($linkfarm_depth eq 'full') { $pre .= <<'END_FILES_FULL' (set -e; cd "$src"; find . \! -name Cargo.lock \! \( -name .git -prune \) \! -type d -print0) | END_FILES_FULL } $pre .= <<'END_DEEP'; perl -0 -ne ' BEGIN { $src=shift @ARGV; } next if (readlink "$_"//"") eq "$src/$_"; unlink "$_"; symlink "$src/$_", "$_" or die "$_ $!"; ' "$src"; END_DEEP } elsif ($linkfarm_depth =~ m/^copy-edit/) { $pre .= <<'END_COPY_EDIT_PRE'; find -lname "$src/*" -print0 | xargs -0r rm --; (set -e; cd "$src"; git ls-files -c -z | cpio --quiet -p0m --no-preserve-owner -u --make-directories "$bld/$sd"); END_COPY_EDIT_PRE } else { die "$linkfarm_depth ?"; } if ($linkfarm_depth =~ m/^copy-edit/) { $pre .= <<'END_COPY_EDIT'; clean () { (set -e; cd "$src"; git ls-files -c -z) | xargs -0r rm -df --; }; END_COPY_EDIT if ($linkfarm_depth eq 'copy-edit-all') { $post .= <<'END_COPY_EDIT_GENFILES_ALL'; find -xdev \( \( -name .git -o -path ./target -o -path ./nailing-cargo-update.tar \) -prune \) -o \( -type l -o -type f \) -print0 | END_COPY_EDIT_GENFILES_ALL } else { $post .= <<'END_COPY_EDIT_GENFILES_GIT'; (set -e; cd "$src"; git ls-files -c -z) | END_COPY_EDIT_GENFILES_GIT } $post .= <<'END_COPY_EDIT_BUNDLE'; cpio -Hustar -o0 --quiet >"nailing-cargo-update.tar"; END_COPY_EDIT_BUNDLE $pre .= <<'ENDLK' if $do_cargo_lock; if test -e Cargo.lock || test -e "$src"/Cargo.lock; then rm -f Cargo.lock; cp -- "$src"/Cargo.lock .; fi; ENDLK } # endif copy-edit $post .= <<'ENDCLEAN' if $oot_clean && !$just_linkfarm; clean; ENDCLEAN } my $addpath = (cfg_uc qw(oot path_add)) // $use eq 'really' || $use eq 'sudo' ? Types::Serialiser::true : Types::Serialiser::false; $addpath = !Types::Serialiser::is_bool $addpath ? $addpath : $addpath ? '$HOME/.cargo/bin' : undef; if (defined $addpath) { $pre .= <= 2 ? 'xe' : 'e'; my $sh_ec = sub { if (!length $post) { @command = (@_, 'sh',"-${xe}c",$pre.'exec "$@"','--',@xargs); } else { @command = (@_, 'sh',"-${xe}c",$pre.'"$@"; '.$post,'--',@xargs); } my $eff_chdir = "$clisubdir$chdir"; if (length $eff_chdir) { push @command, "env", "--chdir=$eff_chdir", "--"; } push @command, @ARGV; }; my $command_sh = sub { my $quoted = shell_quotify @ARGV; my $qargs = shell_quotify @xargs; @command = (@_, "set -${xe}; set -- $qargs; $pre $quoted; $post"); }; if ($verbose) { if ($gitxfer) { print STDERR "$self: out-of-tree, git, building in: \`$build_absdir'\n"; } else { print STDERR "$self: out-of-tree, raw, building in: \`$build_absdir'\n"; } } if ($use eq 'really') { my $user = $getuser->(); my @pw = getpwnam $user or die "$self: oot.user \`$user' lookup failed\n"; my $homedir = $pw[7]; $sh_ec->('really','-u',$user,'env',"HOME=$homedir"); print STDERR "$self: using really to run as user \`$user'\n" if $verbose; } elsif ($use eq 'sudo') { my $user = $getuser->(); $sh_ec->(qw(sudo -u), $user); print STDERR "$self: using sudo to run as user \`$user'\n" if $verbose; } elsif ($use eq 'ssh') { my $user = $getuser->(); $user .= '@localhost' unless $user =~ m/\@/; $command_sh->('ssh',$user); print STDERR "$self: using ssh to run as \`$user'\n" if $verbose; } elsif ($use eq 'command_args') { my @c = cfgn_list qw(oot command); $sh_ec->(@c); print STDERR "$self: out-of-tree, adverbial command: @c\n" if $verbose; } elsif ($use eq 'command_sh') { my @c = cfgn_list qw(oot command); $command_sh->(@c); print STDERR "$self: out-of-tree, ssh'ish command: @c\n" if $verbose; } elsif ($use eq 'null') { $sh_ec->(); } else { die "$self: oot.use mode $use not recognised\n"; } die unless @command; @ARGV = @command; } sub setenvs () { $ENV{CARGO_MANIFEST_DIR} = $src_absdir.$clisubdir unless !$gitxfer && $linkfarm_depth; $ENV{NAILINGCARGO_MANIFEST_DIR} = $src_absdir.$clisubdir; $ENV{NAILINGCARGO_WORKSPHERE} = $worksphere; $ENV{NAILINGCARGO_BUILDSPHERE} = $oot_absdir; delete $ENV{NAILINGCARGO_BUILDSPHERE} unless $oot_absdir; $ENV{NAILINGCARGO_BUILD_DIR} = ($build_absdir // $src_absdir).$clisubdir; } our $want_uninstall; END { if ($want_uninstall) { local ($?); foreach my $mf (keys %manifests) { eval { uninstall1($mf,1); 1; } or warn "$@"; } eval { unaltcargolock(1); 1; } or warn "$@"; } } sub consider_directories () { return unless defined $oot_dir; my $bsubdir = "../$oot_dir/$subdir"; return if stat $bsubdir; die "$0: build directory $bsubdir inaccessible\n" unless $!==ENOENT; } our $cleanup_cargo_lock; sub makebackups () { foreach my $mf (keys %manifests) { link "$mf", "$mf.unnailed" or $!==EEXIST or die "$self: make backup link $mf.unnailed: $!\n"; } if (defined($alt_cargo_lock)) { die 'internal error' unless $do_cargo_lock; if (@alt_cargo_lock_stat) { print STDERR "$self: using alt_cargo_lock `$alt_cargo_lock'..." if $verbose>=3; if (link $alt_cargo_lock, 'Cargo.lock') { print STDERR " linked\n" if $verbose>=3; } elsif ($! != EEXIST) { print STDERR "\n" if $verbose>=3; die "$self: make \`Cargo.lock' available as \`$alt_cargo_lock': $!\n"; } else { print STDERR "checking quality." if $verbose>=3; my @lock_stat = stat 'Cargo.lock' or die "$self: stat Cargo.lock (for alt check: $!\n"; same_file(\@alt_cargo_lock_stat, \@lock_stat) or die "$self: \`Cargo.lock' and alt file \`$alt_cargo_lock' both exist and are not the same file!\n"; } $cleanup_cargo_lock = 1; } else { $cleanup_cargo_lock = 1; # If Cargo.lock exists and alt doesn't, that means either # that a previous run was interrupted, or that the user has # messed up. } } } sub nailed ($) { my ($mf) = @_; my $nailed = "$mf.nailed~"; $nailed =~ s{/([^/]+)$}{/.$1} or die; $nailed; } sub install () { my @our_unfound_stab = stat_exists('Cargo.toml', 'local Cargo.toml') ? (stat _) : (); foreach my $mf (keys %manifests) { if (@our_unfound_stab) { if (stat_exists $mf, "manifest in to-be-nailed directory") { my @mf_stab = stat _ ; if ("@mf_stab[0..1]" eq "@our_unfound_stab[0..1]") { @our_unfound_stab = (); } } } my $nailing = "$mf.nailing~"; my $nailed = nailed($mf); my ($use, $rm); my $diff; if (open NN, '<', $nailed) { $diff = compare($nailing, \*NN); die "$self: compare $nailing and $nailed: $!" if $diff<0; } else { $!==ENOENT or die "$self: check previous $nailed: $!\n"; $diff = 1; } if ($diff) { $use = $nailing; $rm = $nailed; } else { $use = $nailed; $rm = $nailing; } rename $use, $mf or die "$self: install nailed $use: $!\n"; unlink_or_enoent $rm or die "$self: remove old $rm: $!\n"; print STDERR "$self: nailed $mf\n" if $verbose>=3; } # Warn only if subdirs had something in it. if (@our_unfound_stab && %manifests) { print STDERR "$self: *WARNING* cwd is not in Cargo.nail though it has Cargo.toml!\n"; } } sub invoke () { my $r = system @ARGV; if (!$r) { return 0; } elsif ($r<0) { print STDERR "$self: could not execute $ARGV[0]: $!\n"; return 127; } elsif ($r & 0xff00) { print STDERR "$self: $ARGV[0] failed (exit status $r)\n"; return $r >> 8; } else { print STDERR "$self: $ARGV[0] died due to signal! (wait status $r)\n"; return 125; } } sub files_return_after_update () { return unless defined $oot_dir; if ($edits_sources) { if ($gitxfer) { my $cmd = ''; $cmd .= "set -x;" if $verbose >= 2; $cmd .= ': in source tree;'; $cmd .= <<'END_GIT_XFER_RETURN'; git_dir=$(git rev-parse --git-dir); mkdir -p -- "$git_dir"/nailing-cargo; rm -rf "$git_dir"/nailing-cargo/stunt-copy; mkdir -- "$git_dir"/nailing-cargo/stunt-copy; GIT_DIR="$git_dir"/nailing-cargo/stunt-copy git init; mkdir -p -- "$git_dir"/nailing-cargo/stunt-copy/info; rm -rf "$git_dir"/nailing-cargo/stunt-copy/objects "$git_dir"/nailing-cargo/stunt-copy/info/refs "$git_dir"/nailing-cargo/stunt-copy/refs; ln -s "$1"/.git/objects "$git_dir"/nailing-cargo/stunt-copy/objects; ln -s "$1"/.git/refs "$git_dir"/nailing-cargo/stunt-copy/refs; ln -s "$1"/.git/info/refs "$git_dir"/nailing-cargo/stunt-copy/info/refs; git fetch -q "$git_dir"/nailing-cargo/stunt-copy +refs/nailing-cargo/edited:refs/nailing-cargo/edited; if test -e "$git_dir"/index; then cp -- "$git_dir"/index "$git_dir"/nailing-cargo/index; fi; export GIT_INDEX_FILE="$git_dir"/nailing-cargo/index; END_GIT_XFER_RETURN if ($edits_sources >= 2) { $cmd .= <<'END_GIT_XFER_CHECKOUT_ALL' git checkout refs/nailing-cargo/edited -- .; END_GIT_XFER_CHECKOUT_ALL } else { # This horrible rune involving grep and perl is there to exclude # submodules, which appear in git ls-files but which can't be fed # to git checkout. $cmd .= <<'END_GIT_XFER_CHECKOUT_EXISTING' git ls-files -c -z | grep -z -v -F -f <(git ls-tree -zr HEAD | perl -0 -ne 'print if s{^\d+ commit \w+\t}{}') | xargs -0r git checkout refs/nailing-cargo/edited --; END_GIT_XFER_CHECKOUT_EXISTING } $cmd =~ s/^\s+//mg; $cmd =~ s/\s+/ /g; if ($dump) { eval ' use Data::Dumper; print STDERR Dumper($build_absdir, $cmd); ' or die $@; } system qw(bash -ec), $cmd, 'x', $build_absdir; } else { my $tar_source_opts; my $tar_stdin; if ($edits_sources >= 2) { $tar_source_opts = '--null --files-from=-'; $tar_stdin = <<'END_GIT_FILES'; git ls-files -c -z | \ END_GIT_FILES } else { $tar_source_opts = '--anchored --exclude=.git --exclude="*/.git" --exclude=target --exclude=nailing-cargo-update.tar'; $tar_stdin = ''; } system qw(sh -ec), $tar_stdin . <<'END', 'x', "$build_absdir"; tar -x --keep-newer-files --no-same-permissions --no-same-owner \ --no-acls --no-selinux --no-xattrs --warning=no-ignore-newer \ -Hustar $tar_source_opts --force-local \ -f "$1/nailing-cargo-update.tar" END } } elsif ($do_cargo_lock && $cargo_lock_update && !$just_linkfarm) { # avoids importing File::Copy and the error handling is about as good $!=0; $?=0; my $r= system qw(cp --), "$build_absdir/Cargo.lock", "Cargo.lock"; die "$self: run cp: $! $?" if $r<0 || $r & 0xff; die "$self: failed to update local Cargo.lock (wait status $r)\n" if $r; } } sub uninstall1 ($$) { my ($mf, $enoentok) = @_; my $unnailed = "$mf.unnailed"; rename $unnailed, $mf or ($enoentok && $!==ENOENT) or die "$self: failed to restore: rename $unnailed back to $mf: $!\n"; } sub unaltcargolock ($) { my ($enoentok) = @_; return unless $cleanup_cargo_lock; die 'internal error!' unless $do_cargo_lock && defined $alt_cargo_lock; # we ignore $enoentok because we don't know if one was supposed to # have been created. rename('Cargo.lock', $alt_cargo_lock) or $!==ENOENT or die "$self: cleanup: rename possibly-updated \`Cargo.lock' to \`$alt_cargo_lock': $!\n"; unlink 'Cargo.lock' or $!==ENOENT or die "$self: cleanup: remove \`Cargo.lock' in favour of \`$alt_cargo_lock': $!\n"; # ^ this also helps clean up the stupid rename() corner case } sub uninstall () { foreach my $mf (keys %manifests) { my $nailed = nailed($mf); link $mf, $nailed or die "$self: preserve (link) $mf as $nailed: $!\n"; uninstall1($mf,0); } unaltcargolock(0); } sub parse_args () { my $is_cargo; # Loop exit condition: # $is_cargo is set # @ARGV contains # $is_cargo==1 [--] ... # $is_cargo==0 ... OPTS: for (;;) { if (!@ARGV) { die "$self: need cargo subcommand\n" unless $noact || $just_linkfarm;; push @ARGV, "CARGO-SUBCOMMAND"; # dummy, user may see it } $_ = shift @ARGV; my $orgopt = $_; my $not_a_nailing_opt = sub { # usage 1 unshift @ARGV, $orgopt; if ($orgopt =~ m{^\+}) { # We don't have the usual_toolchain here since we haven't # read the config yet. Insert this dummy argument which # we'll substitute later. This can't occur some other way # because no-one can pass nuls into arguments. $arg_toolchain = $&; } else { unshift @ARGV, "\0+"; } unshift @ARGV, 'cargo'; $is_cargo = 1; no warnings qw(exiting); last OPTS; }; $not_a_nailing_opt->() unless m{^-}; $not_a_nailing_opt->() if $_ eq '--'; if ($_ eq '---') { # usage 2 or 3 if (!@ARGV) { die "$self: --- must be followed by build command\n" unless $noact; push @ARGV, 'BUILD-COMMAND'; } if ($ARGV[0] eq '--') { # usage 3 shift @ARGV; $is_cargo = 0; } elsif (grep { $_ eq '--' } @ARGV) { # usage 2 $is_cargo = 1; } elsif ($ARGV[0] =~ m{[^/]*cargo[^/]*$}) { # usage 2 $is_cargo = 1; } else { # usage 3 $is_cargo = 0; } last; } if (m{^-[^-]}) { while (m{^-.}) { if (s{^-h}{-}) { print_usage(); } elsif (s{^-v}{-}) { $verbose++; } elsif (s{^-q}{-}) { $verbose=0; } elsif (s{^-n}{-}) { $noact++; } elsif (s{^-f}{-}) { $force++; } elsif (s{^-s(.+)}{-}s) { $cargo_subcmd = $1; } elsif (s{^-([uU])}{-}) { $cargo_lock_update = $1=~m/[a-z]/; } elsif (s{^-([cC])}{-}) { $pass_options = $1=~m/[a-z]/; } elsif (s{^-D}{-}) { $dump++; } elsif (s{^-E}{-}) { $edits_sources++; } elsif (s{^-T(.+)}{-}s) { $target = $1; } elsif (s{^-([oO])}{-}) { $online = $1=~m/[a-z]/; } else { die "$self: unknown short option(s) $_\n" unless $_ eq $orgopt; $not_a_nailing_opt->(); } } } elsif (s{^--help$}{}) { print_usage(); } elsif (s{^--(?:doc|man|manual)?$}{}) { show_manual(); } elsif (s{^--target=}{}) { $target = $_; } elsif (m{^--(on|off)line$}) { $online = $1 eq 'on'; } elsif (m{^--(no-)?git$}) { $gitxfer = !$1; } elsif (m{^--just-git$}) { $just_linkfarm = 1; $cargo_lock_update= 1; # will set $linkfarm_detph to 1 by default $linkfarm_depth = 'git'; $gitxfer = 1; } elsif (m{^--just-linkfarm(?:=(shallow|git|full))?$}) { $just_linkfarm = 1; $linkfarm_depth = $1 if $1; $cargo_lock_update= 1; # will set $linkfarm_detph to 1 by default } elsif (m{^--linkfarm(?:=(no|shallow|git|full))?$}) { $linkfarm_depth = $1 || 'git'; } elsif (m{^--edits?-sources?$}) { $edits_sources++; } elsif (m{^--force$}) { $force++; } elsif (m{^--just-run$}) { $do_nail = $do_cargo_lock = $do_lock = $gitxfer = 0; } elsif (m{^--subdir=(.*)$}) { $clisubdir = $1; die "$self: --subdir value must be relative\n" if $clisubdir =~ m,^/,; $clisubdir =~ s,/$,,; $clisubdir = $clisubdir.'/'; } elsif (m{^--chdir=(.*)$}) { $chdir = $1; } elsif (m{^--(clean|keep)-linkfarm$}) { $oot_clean = $1 eq 'clean'; } elsif (m{^--(no-)?preclean-build$}) { $oot_preclean = $1 ? 'no' : 'src'; } elsif (m{^--preclean(?:-build)?(?:=(no|src|full))?$}) { $oot_preclean = $1 // 'src'; } elsif (m{^--(no-)?nail$}) { $do_nail = !$1; } elsif (m{^--(no-)?cargo-lock-manip$}) { $do_cargo_lock = !$1; } elsif (m{^--(no-)?concurrency-lock$}) { $do_lock = !$1; } elsif (m{^--leave-nailed$}) { $leave_nailed = 1; } elsif (s{^--nailfile=}{}) { $nailfile = $_; } elsif (s{^--subcommand-props=}{}) { my @props = split /\,/, $_; our %subcmd_prop_ok; if (!%subcmd_prop_ok) { foreach my $v (\@subcmd_xprops, values %subcmd_props) { $subcmd_prop_ok{$_}=1 foreach @$v; }; } $subcmd_prop_ok{$_} or die "$self: unknown subcommand property \`$_'\n" foreach @props; $cargo_subcmd = \@props; } elsif (m{^--(no-)?cargo-lock-update}) { $cargo_lock_update= !!$1; } else { $not_a_nailing_opt->(); } } $is_cargo // die; @ARGV || die; if (defined $gitxfer) { } elsif (stat ".git") { $gitxfer = 1; } elsif ($! == ENOENT) { $gitxfer = 0; } else { die "$self: checking for .git (for default value of --git): $!\n"; } $src_absdir = getcwd() // die "$self: getcwd failed: $!\n"; if ($gitxfer) { $?=0; $!=0; my $cdup = `git rev-parse --show-cdup` // die $!; $? and die "git rev-parse --show-cdup: $?"; chomp $cdup; if (length $cdup) { chdir $cdup // die "cd $cdup (from $subdir) $!"; my $topdir = getcwd; $topdir // die "getcwd topdir $!"; my $prefix = "$topdir/"; print STDERR "nailing-cargo: toplevel is $topdir ($cdup)\n"; substr($src_absdir, 0, length $prefix) eq $prefix or die "dir confusion: $src_absdir doesn't start with $prefix ?"; $chdir //= substr($src_absdir, length $prefix); $src_absdir = $topdir; } } $worksphere = $src_absdir; $worksphere =~ s{/([^/]+)$}{} or die "$self: cwd \`$worksphere' unsupported!\n"; $subdir = $1; # leafname $chdir //= ''; if ($is_cargo) { @args_preface = shift @ARGV; while (defined($_ = shift @ARGV)) { if (!m{^-|^\0?\+}) { unshift @ARGV, $_; last; } if ($_ eq '--') { last; } push @args_preface, $_; } @ARGV || die "$self: need cargo subcommand\n"; $cargo_subcmd //= $ARGV[0]; $pass_options //= 1; } else { $cargo_subcmd //= ''; $pass_options //= 0; } push @args_preface, shift @ARGV; if (!ref($cargo_subcmd)) { print STDERR " cargo_subcmd lookup $cargo_subcmd\n" if $dump; $cargo_subcmd = $subcmd_props{$cargo_subcmd} // [ ]; } print STDERR " cargo_subcmd props @$cargo_subcmd\n" if $dump; my %cargo_subcmd; $cargo_subcmd{$_} = 1 foreach @$cargo_subcmd; $cargo_subcmd = \%cargo_subcmd; } parse_args(); loadconfigs(); readnail(); takelock(); consider_alt_cargo_lock(); consider_oot(); readorigs(); calculate(); addargs(); consider_directories(); our @display_cmd = @ARGV; oot_massage_cmdline(); setenvs(); if ($dump) { eval ' use Data::Dumper; print STDERR Dumper(\%manifests) if $dump>=2; print STDERR Dumper(\%packagemap, \@args_preface, \@ARGV, { src_absdir => $src_absdir, worksphere => $worksphere, subdir => $subdir, oot_dir => $oot_dir, oot_absdir => $oot_absdir, build_absdir => $build_absdir, gitxfer => $gitxfer, linkfarm_depth => $linkfarm_depth, oot_preclean => $oot_preclean, force => $force,, forced => $forced,}); ' or die $@; } exit 0 if $noact; $want_uninstall = !$leave_nailed; makebackups(); install(); printf STDERR "$self: nailed (%s manifests, %s packages)%s\n", (scalar keys %manifests), (scalar keys %packagemap), (defined($alt_cargo_lock) and ", using `$alt_cargo_lock'") if $verbose && $do_nail; print STDERR "$self: invoking: @display_cmd\n" if $verbose; my $estatus = invoke(); files_return_after_update(); uninstall() unless $leave_nailed; $want_uninstall = 0; print STDERR "$self: ".(%manifests ? "unnailed" : "finished") .". status $estatus.\n" if $verbose; exit $estatus; work/update-readme-toc0000775000000000000000000000013714777226410012171 0ustar #!/bin/sh set -e ./markdown-toc-filter README.md.tmp mv -f README.md.tmp README.md