pax_global_header00006660000000000000000000000064146622411410014513gustar00rootroot0000000000000052 comment=c9d466b775ea3f7a60b94033c201b6fee12d51e8 libsyntax-keyword-junction-perl-0.003009/000077500000000000000000000000001466224114100202345ustar00rootroot00000000000000libsyntax-keyword-junction-perl-0.003009/Changes000066400000000000000000000027471466224114100215410ustar00rootroot00000000000000Revision history for Syntax-Keyword-Junction 0.003009 2024-08-20 - fixed smart match warnings on perls 5.38 or greater - stop enabling smart match support on perl 5.41 or greater - many packaging cleanups - removed direct dependency on syntax.pm 0.003008 2014-07-06 20:08:35-05:00 America/Chicago - Stop using base.pm (Olivier Mengué) 0.003007 2013-11-23 14:28:14 America/Chicago - Minor typo fixes 0.003006 2013-08-06 18:16:08 CST6CDT - Finally really silence warnings above 5.17.10 - Remove useless array copy to measurably improve performance (Maxime Soulé) - Make tests pass even if Sub::Exporter is not installed 0.003005 2013-08-05 08:05:47 CST6CDT - Set version for Test::More dep (reported by ppisar) 0.003004 2013-04-28 19:00:36 CST6CDT - Silence even more warnings above 5.17.10 (RJBS) 0.003003 2013-04-10 06:38:29 CST6CDT - Silence warnings above 5.17.10 0.003002 2012-11-17 16:20:07 CST6CDT - Put MetaYAML back in dist 0.003001 2012-09-02 22:06:43 America/Chicago - Fix tests for perl 5.8 (Rob Hoelz) 0.003000 2012-08-29 10:10:08 America/Chicago - Add ~~ support for 5.10.1 and higher (RJBS) - Add ->map method on junctions for easy creation of new junctions (RJBS) - Switch to Sub::Exporter::Progressive 0.002001 2010-11-07 22:44:18 CST6CDT - Add syntax.pm as a dep 0.002000 2010-11-06 22:47:32 CST6CDT - Add support for syntax.pm - Switch to Sub::Exporter 0.001000 2010-11-06 19:22:48 CST6CDT - Initial fork of Perl6::Junction libsyntax-keyword-junction-perl-0.003009/LICENSE000066400000000000000000000465011466224114100212470ustar00rootroot00000000000000This software is copyright (c) 2024 by Arthur Axel "fREW" Schmidt. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2024 by Arthur Axel "fREW" Schmidt. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Perl Artistic License 1.0 --- This software is Copyright (c) 2024 by Arthur Axel "fREW" Schmidt. This is free software, licensed under: The Perl Artistic License 1.0 The "Artistic License" Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder as specified below. "Copyright Holder" is whoever is named in the copyright or copyrights for the package. "You" is you, if you're thinking about copying or distributing this Package. "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as uunet.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) give non-standard executables non-standard names, and clearly document the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. You may embed this Package's interpreter within an executable of yours (by linking); this shall be construed as a mere form of aggregation, provided that the complete Standard Version of the interpreter is so embedded. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whoever generated them, and may be sold commercially, and may be aggregated with this Package. If such scripts or library files are aggregated with this Package via the so-called "undump" or "unexec" methods of producing a binary executable image, then distribution of such an image shall neither be construed as a distribution of this Package nor shall it fall under the restrictions of Paragraphs 3 and 4, provided that you do not represent such an executable image as a Standard Version of this Package. 7. C subroutines (or comparably compiled subroutines in other languages) supplied by you and linked into this Package in order to emulate subroutines and variables of the language defined by this Package shall not be considered part of this Package, but are the equivalent of input as in Paragraph 6, provided these subroutines do not change the language in any way that would cause it to fail the regression tests for the language. 8. Aggregation of this Package with a commercial distribution is always permitted provided that the use of this Package is embedded; that is, when no overt attempt is made to make this Package's interfaces visible to the end user of the commercial distribution. Such use shall not be construed as a distribution of this Package. 9. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End libsyntax-keyword-junction-perl-0.003009/MANIFEST000066400000000000000000000014431466224114100213670ustar00rootroot00000000000000# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.031. Changes LICENSE MANIFEST META.json META.yml Makefile.PL README dist.ini lib/Syntax/Feature/Junction.pm lib/Syntax/Keyword/Junction.pm lib/Syntax/Keyword/Junction/All.pm lib/Syntax/Keyword/Junction/Any.pm lib/Syntax/Keyword/Junction/Base.pm lib/Syntax/Keyword/Junction/None.pm lib/Syntax/Keyword/Junction/One.pm t/00-compile.t t/00-report-prereqs.dd t/00-report-prereqs.t t/01_use.t t/all.t t/any.t t/import_tags.t t/join.t t/no_import.t t/none.t t/one.t t/smartmatch.t t/syntax.t weaver.ini xt/author/distmeta.t xt/author/eol.t xt/author/mojibake.t xt/author/no-tabs.t xt/author/pod-spell.t xt/author/pod-syntax.t xt/author/portability.t xt/author/test-version.t xt/release/changes_has_content.t xt/release/cpan-changes.t libsyntax-keyword-junction-perl-0.003009/META.json000066400000000000000000000071411466224114100216600ustar00rootroot00000000000000{ "abstract" : "Comparisons against multiple values", "author" : [ "Arthur Axel \"fREW\" Schmidt ", "Carl Franks" ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.031, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Syntax-Keyword-Junction", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" }, "suggests" : { "JSON::PP" : "2.27300" } }, "develop" : { "requires" : { "Test::CPAN::Changes" : "0.19", "Test::CPAN::Meta" : "0", "Test::EOL" : "0", "Test::Mojibake" : "0", "Test::More" : "0.88", "Test::NoTabs" : "0", "Test::Pod" : "1.41", "Test::Portability::Files" : "0", "Test::Spelling" : "0.12", "Test::Version" : "1" } }, "runtime" : { "requires" : { "Sub::Exporter::Progressive" : "0.001006", "parent" : "0", "perl" : "5.006" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900" }, "requires" : { "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Test::More" : "0.88", "Test::Needs" : "0.002006" } } }, "provides" : { "Syntax::Feature::Junction" : { "file" : "lib/Syntax/Feature/Junction.pm", "version" : "0.003009" }, "Syntax::Keyword::Junction" : { "file" : "lib/Syntax/Keyword/Junction.pm", "version" : "0.003009" }, "Syntax::Keyword::Junction::All" : { "file" : "lib/Syntax/Keyword/Junction/All.pm", "version" : "0.003009" }, "Syntax::Keyword::Junction::Any" : { "file" : "lib/Syntax/Keyword/Junction/Any.pm", "version" : "0.003009" }, "Syntax::Keyword::Junction::Base" : { "file" : "lib/Syntax/Keyword/Junction/Base.pm", "version" : "0.003009" }, "Syntax::Keyword::Junction::None" : { "file" : "lib/Syntax/Keyword/Junction/None.pm", "version" : "0.003009" }, "Syntax::Keyword::Junction::One" : { "file" : "lib/Syntax/Keyword/Junction/One.pm", "version" : "0.003009" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/haarg/Syntax-Keyword-Junction/issues" }, "repository" : { "type" : "git", "url" : "https://github.com/haarg/Syntax-Keyword-Junction.git", "web" : "https://github.com/haarg/Syntax-Keyword-Junction" } }, "version" : "0.003009", "x_contributors" : [ "Arthur Axel 'fREW' Schmidt ", "Carl Franks ", "David Steinbrunner ", "Graham Knop ", "Maxime Soul\u00e9 ", "Michael Schout ", "Olivier Mengu\u00e9 ", "Paul Cochrane ", "Ricardo Signes ", "Rob Hoelz " ], "x_generated_by_perl" : "v5.38.2", "x_serialization_backend" : "Cpanel::JSON::XS version 4.37", "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later", "x_use_unsafe_inc" : 0 } libsyntax-keyword-junction-perl-0.003009/META.yml000066400000000000000000000041121466224114100215030ustar00rootroot00000000000000--- abstract: 'Comparisons against multiple values' author: - 'Arthur Axel "fREW" Schmidt ' - 'Carl Franks' build_requires: ExtUtils::MakeMaker: '0' File::Spec: '0' IO::Handle: '0' IPC::Open3: '0' Test::More: '0.88' Test::Needs: '0.002006' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.031, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Syntax-Keyword-Junction provides: Syntax::Feature::Junction: file: lib/Syntax/Feature/Junction.pm version: '0.003009' Syntax::Keyword::Junction: file: lib/Syntax/Keyword/Junction.pm version: '0.003009' Syntax::Keyword::Junction::All: file: lib/Syntax/Keyword/Junction/All.pm version: '0.003009' Syntax::Keyword::Junction::Any: file: lib/Syntax/Keyword/Junction/Any.pm version: '0.003009' Syntax::Keyword::Junction::Base: file: lib/Syntax/Keyword/Junction/Base.pm version: '0.003009' Syntax::Keyword::Junction::None: file: lib/Syntax/Keyword/Junction/None.pm version: '0.003009' Syntax::Keyword::Junction::One: file: lib/Syntax/Keyword/Junction/One.pm version: '0.003009' requires: Sub::Exporter::Progressive: '0.001006' parent: '0' perl: '5.006' resources: bugtracker: https://github.com/haarg/Syntax-Keyword-Junction/issues repository: https://github.com/haarg/Syntax-Keyword-Junction.git version: '0.003009' x_contributors: - "Arthur Axel 'fREW' Schmidt " - 'Carl Franks ' - 'David Steinbrunner ' - 'Graham Knop ' - 'Maxime Soulé ' - 'Michael Schout ' - 'Olivier Mengué ' - 'Paul Cochrane ' - 'Ricardo Signes ' - 'Rob Hoelz ' x_generated_by_perl: v5.38.2 x_serialization_backend: 'YAML::Tiny version 1.74' x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' x_use_unsafe_inc: 0 libsyntax-keyword-junction-perl-0.003009/Makefile.PL000066400000000000000000000026521466224114100222130ustar00rootroot00000000000000# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.031. use strict; use warnings; use 5.006; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Comparisons against multiple values", "AUTHOR" => "Arthur Axel \"fREW\" Schmidt , Carl Franks", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "Syntax-Keyword-Junction", "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.006", "NAME" => "Syntax::Keyword::Junction", "PREREQ_PM" => { "Sub::Exporter::Progressive" => "0.001006", "parent" => 0 }, "TEST_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::More" => "0.88", "Test::Needs" => "0.002006" }, "VERSION" => "0.003009", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Sub::Exporter::Progressive" => "0.001006", "Test::More" => "0.88", "Test::Needs" => "0.002006", "parent" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); libsyntax-keyword-junction-perl-0.003009/README000066400000000000000000000122621466224114100211170ustar00rootroot00000000000000NAME Syntax::Keyword::Junction - Comparisons against multiple values SYNOPSIS use Syntax::Keyword::Junction qw/ all any none one /; if (any(@grant) eq 'su') { ... } if (all($foo, $bar) >= 10) { ... } if (qr/^\d+$/ == all(@answers)) { ... } if (all(@input) <= scalar @limits) { ... } if (none(@pass) eq 'password') { ... } if (one(@answer) == 42) { ... } or if you want to rename an export, use Sub::Exporter options: use Syntax::Keyword::Junction any => { -as => 'robot_any' }; if (robot_any(@grant) eq 'su') { ... } DESCRIPTION This is a lightweight module which provides 'Junction' operators, the most commonly used being "any" and "all". Inspired by the Perl 6 design docs, . Provides a limited subset of the functionality of Quantum::Superpositions, see "SEE ALSO" for comment. Notice in the "SYNOPSIS" above, that if you want to match against a regular expression, you must use "==" or "!=". Not "=~" or "!~". You must also use a regex object, such as "qr/\d/", not a plain regex such as "/\d/". SUBROUTINES all() Returns an object which overloads the following operators: '<', '<=', '>', '>=', '==', '!=', 'lt', 'le', 'gt', 'ge', 'eq', 'ne', '~~' Returns true only if all arguments test true according to the operator used. any() Returns an object which overloads the following operators: '<', '<=', '>', '>=', '==', '!=', 'lt', 'le', 'gt', 'ge', 'eq', 'ne', '~~' Returns true if any argument tests true according to the operator used. none() Returns an object which overloads the following operators: '<', '<=', '>', '>=', '==', '!=', 'lt', 'le', 'gt', 'ge', 'eq', 'ne', '~~' Returns true only if no argument tests true according to the operator used. one() Returns an object which overloads the following operators: '<', '<=', '>', '>=', '==', '!=', 'lt', 'le', 'gt', 'ge', 'eq', 'ne', '~~' Returns true only if one and only one argument tests true according to the operator used. ALTERING JUNCTIONS You cannot alter junctions. Instead, you can create new junctions out of old junctions. You can do this by calling the "values" method on a junction. my $numbers = any(qw/1 2 3 4 5/); print $numbers == 3 ? 'Yes' : 'No'; # Yes $numbers = any( grep { $_ != 3 } $numbers->values ); print $numbers == 3 ? 'Yes' : 'No'; # No You can also use the "map" method: my $numbers = any(qw/1 2 3 4 5/); my $prime = $numbers->map( \&is_prime ); say for $prime->values; # prints 0, 1, 1, 0, 1 EXPORT 'all', 'any', 'none', 'one', as requested. All subroutines can be called by its fully qualified name, if you don't want to export them. use Syntax::Keyword::Junction; if (Syntax::Keyword::Junction::any( @questions )) { ... } WARNING When comparing against a regular expression, you must remember to use a regular expression object: "qr/\d/" Not "/d/". You must also use either "==" or "!=". This is because "=~" and "!~" cannot be overridden. TO DO Add overloading for arithmetic operators, such that this works: $result = any(2,3,4) * 2; if ($result == 8) {...} SEE ALSO This module is actually a fork of Perl6::Junction with very few (initial) changes. The reason being that we want to avoid the incendiary name containing Perl 6. Quantum::Superpositions provides the same functionality as this, and more. However, this module provides this limited functionality at a much greater runtime speed, with my benchmarks showing between 500% and 6000% improvement. - "The Wonderful World of Junctions". BUGS Please report any bugs or feature requests on the bugtracker website When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. CONTRIBUTORS * Arthur Axel 'fREW' Schmidt * Carl Franks * David Steinbrunner * Graham Knop * Maxime Soulé * Michael Schout * Olivier Mengué * Paul Cochrane * Ricardo Signes * Rob Hoelz AUTHORS * Arthur Axel "fREW" Schmidt * Carl Franks COPYRIGHT AND LICENSE This software is copyright (c) 2024 by Arthur Axel "fREW" Schmidt. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. libsyntax-keyword-junction-perl-0.003009/dist.ini000066400000000000000000000027651466224114100217120ustar00rootroot00000000000000name = Syntax-Keyword-Junction author = Arthur Axel "fREW" Schmidt author = Carl Franks license = Perl_5 copyright_holder = Arthur Axel "fREW" Schmidt ;;; Gather [Git::GatherDir] include_dotfiles = 1 exclude_match = ^\.git exclude_filename = cpanfile ;;; Metadata [Git::Contributors] [MetaProvides::Package] [MetaResources] bugtracker.web = https://github.com/haarg/Syntax-Keyword-Junction/issues repository.url = https://github.com/haarg/Syntax-Keyword-Junction.git repository.web = https://github.com/haarg/Syntax-Keyword-Junction repository.type = git [Prereqs::FromCPANfile] [UseUnsafeInc] dot_in_INC = 0 ;;; Modification [PodWeaver] ; authordep Pod::Weaver::Section::Contributors ; authordep Pod::Weaver::Section::ReplaceVersion ; authordep Pod::Weaver::Plugin::StopWords ;;; Extra Files [License] [MetaJSON] [MetaYAML] [Manifest] [Pod2Readme] ;;; Installer [MakeMaker] ;;; Release [TestRelease] [RunExtraTests] [ConfirmRelease] [UploadToCPAN] [Git::Check] [Git::Remote::Check] branch = main [@Git::VersionManager] -remove = Prereqs NextRelease.format = %-8v %{yyyy-MM-dd}d%{ (TRIAL RELEASE)}T [Git::Push] ;;; Tests [MetaTests] [MojibakeTests] [PodSyntaxTests] [Test::CPAN::Changes] [Test::ChangesHasContent] [Test::Compile] [Test::EOL] ;[Test::MinimumVersion] # can't exclude files [Test::NoTabs] ;[Test::Perl::Critic] ;critic_config = .perlcriticrc [Test::PodSpelling] [Test::Portability] [Test::ReportPrereqs] [Test::Version] libsyntax-keyword-junction-perl-0.003009/lib/000077500000000000000000000000001466224114100210025ustar00rootroot00000000000000libsyntax-keyword-junction-perl-0.003009/lib/Syntax/000077500000000000000000000000001466224114100222705ustar00rootroot00000000000000libsyntax-keyword-junction-perl-0.003009/lib/Syntax/Feature/000077500000000000000000000000001466224114100236635ustar00rootroot00000000000000libsyntax-keyword-junction-perl-0.003009/lib/Syntax/Feature/Junction.pm000066400000000000000000000033561466224114100260210ustar00rootroot00000000000000package Syntax::Feature::Junction; use strict; use warnings; our $VERSION = '0.003009'; require Syntax::Keyword::Junction; sub install { my ($class, %args) = @_; my $target = $args{into}; my $options = $args{options} || {}; Syntax::Keyword::Junction->import({ into => $target }, %$options ); return 1; } 1; __END__ =pod =encoding UTF-8 =for :stopwords Arthur Axel "fREW" Schmidt Carl Franks =head1 NAME Syntax::Feature::Junction - Provide keywords for any, all, none, or one =head1 SYNOPSIS use syntax 'junction'; if (any(@grant) eq 'su') { ... } if (all($foo, $bar) >= 10) { ... } if (qr/^\d+$/ == all(@answers)) { ... } if (all(@input) <= @limits) { ... } if (none(@pass) eq 'password') { ... } if (one(@answer) == 42) { ... } or if you want to rename an export, use L options: use syntax 'junction' => { any => { -as => 'robot_any' } }; if (robot_any(@grant) eq 'su') { ... } The full documentation for this module is in L. This is just a way to use the sugar that L gives us. =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHORS =over 4 =item * Arthur Axel "fREW" Schmidt =item * Carl Franks =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2024 by Arthur Axel "fREW" Schmidt. 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 libsyntax-keyword-junction-perl-0.003009/lib/Syntax/Keyword/000077500000000000000000000000001466224114100237145ustar00rootroot00000000000000libsyntax-keyword-junction-perl-0.003009/lib/Syntax/Keyword/Junction.pm000066400000000000000000000137131466224114100260500ustar00rootroot00000000000000package Syntax::Keyword::Junction; use strict; use warnings; use 5.006; our $VERSION = '0.003009'; require Syntax::Keyword::Junction::All; require Syntax::Keyword::Junction::Any; require Syntax::Keyword::Junction::None; require Syntax::Keyword::Junction::One; use Sub::Exporter::Progressive -setup => { exports => [qw( all any none one )], groups => { default => [qw( all any none one )], # for the switch from Exporter ALL => [qw( all any none one )], }, }; sub all { Syntax::Keyword::Junction::All->new(@_) } sub any { Syntax::Keyword::Junction::Any->new(@_) } sub none { Syntax::Keyword::Junction::None->new(@_) } sub one { Syntax::Keyword::Junction::One->new(@_) } 1; __END__ =pod =encoding UTF-8 =for :stopwords Arthur Axel "fREW" Schmidt Carl Franks =head1 NAME Syntax::Keyword::Junction - Comparisons against multiple values =head1 SYNOPSIS use Syntax::Keyword::Junction qw/ all any none one /; if (any(@grant) eq 'su') { ... } if (all($foo, $bar) >= 10) { ... } if (qr/^\d+$/ == all(@answers)) { ... } if (all(@input) <= scalar @limits) { ... } if (none(@pass) eq 'password') { ... } if (one(@answer) == 42) { ... } or if you want to rename an export, use L options: use Syntax::Keyword::Junction any => { -as => 'robot_any' }; if (robot_any(@grant) eq 'su') { ... } =head1 DESCRIPTION This is a lightweight module which provides 'Junction' operators, the most commonly used being C and C. Inspired by the Perl 6 design docs, L. Provides a limited subset of the functionality of L, see L for comment. Notice in the L above, that if you want to match against a regular expression, you must use C<==> or C. B C<=~> or C. You must also use a regex object, such as C, not a plain regex such as C. =head1 SUBROUTINES =head2 all() Returns an object which overloads the following operators: '<', '<=', '>', '>=', '==', '!=', 'lt', 'le', 'gt', 'ge', 'eq', 'ne', '~~' Returns true only if B arguments test true according to the operator used. =head2 any() Returns an object which overloads the following operators: '<', '<=', '>', '>=', '==', '!=', 'lt', 'le', 'gt', 'ge', 'eq', 'ne', '~~' Returns true if B argument tests true according to the operator used. =head2 none() Returns an object which overloads the following operators: '<', '<=', '>', '>=', '==', '!=', 'lt', 'le', 'gt', 'ge', 'eq', 'ne', '~~' Returns true only if B argument tests true according to the operator used. =head2 one() Returns an object which overloads the following operators: '<', '<=', '>', '>=', '==', '!=', 'lt', 'le', 'gt', 'ge', 'eq', 'ne', '~~' Returns true only if B argument tests true according to the operator used. =head1 ALTERING JUNCTIONS You cannot alter junctions. Instead, you can create new junctions out of old junctions. You can do this by calling the C method on a junction. my $numbers = any(qw/1 2 3 4 5/); print $numbers == 3 ? 'Yes' : 'No'; # Yes $numbers = any( grep { $_ != 3 } $numbers->values ); print $numbers == 3 ? 'Yes' : 'No'; # No You can also use the C method: my $numbers = any(qw/1 2 3 4 5/); my $prime = $numbers->map( \&is_prime ); say for $prime->values; # prints 0, 1, 1, 0, 1 =head1 EXPORT 'all', 'any', 'none', 'one', as requested. All subroutines can be called by its fully qualified name, if you don't want to export them. use Syntax::Keyword::Junction; if (Syntax::Keyword::Junction::any( @questions )) { ... } =head1 WARNING When comparing against a regular expression, you must remember to use a regular expression object: C B C. You must also use either C<==> or C. This is because C<=~> and C cannot be overridden. =head1 TO DO Add overloading for arithmetic operators, such that this works: $result = any(2,3,4) * 2; if ($result == 8) {...} =head1 SEE ALSO This module is actually a fork of L with very few (initial) changes. The reason being that we want to avoid the incendiary name containing Perl 6. L provides the same functionality as this, and more. However, this module provides this limited functionality at a much greater runtime speed, with my benchmarks showing between 500% and 6000% improvement. L - "The Wonderful World of Junctions". =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 CONTRIBUTORS =for stopwords Arthur Axel 'fREW' Schmidt Carl Franks David Steinbrunner Graham Knop Maxime Soulé Michael Schout Olivier Mengué Paul Cochrane Ricardo Signes Rob Hoelz =over 4 =item * Arthur Axel 'fREW' Schmidt =item * Carl Franks =item * David Steinbrunner =item * Graham Knop =item * Maxime Soulé =item * Michael Schout =item * Olivier Mengué =item * Paul Cochrane =item * Ricardo Signes =item * Rob Hoelz =back =head1 AUTHORS =over 4 =item * Arthur Axel "fREW" Schmidt =item * Carl Franks =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2024 by Arthur Axel "fREW" Schmidt. 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 libsyntax-keyword-junction-perl-0.003009/lib/Syntax/Keyword/Junction/000077500000000000000000000000001466224114100255055ustar00rootroot00000000000000libsyntax-keyword-junction-perl-0.003009/lib/Syntax/Keyword/Junction/All.pm000066400000000000000000000073571466224114100265670ustar00rootroot00000000000000package Syntax::Keyword::Junction::All; use strict; use warnings; our $VERSION = '0.003009'; use parent 'Syntax::Keyword::Junction::Base'; BEGIN { if (Syntax::Keyword::Junction::Base::_WANT_SMARTMATCH) { eval '#line '.(__LINE__+1).' "' . __FILE__.qq["\n] . <<'END_CODE' or die $@; no if Syntax::Keyword::Junction::Base::_SMARTMATCH_WARNING_CATEGORY, warnings => Syntax::Keyword::Junction::Base::_SMARTMATCH_WARNING_CATEGORY; sub match { my ( $self, $other, $is_rhs ) = @_; if ($is_rhs) { for (@$self) { return unless $other ~~ $_; } return 1; } for (@$self) { return unless $_ ~~ $other; } return 1; } 1; END_CODE } } sub num_eq { return regex_eq(@_) if ref( $_[1] ) eq 'Regexp'; my ( $self, $test ) = @_; for (@$self) { return unless $_ == $test; } return 1; } sub num_ne { return regex_ne(@_) if ref( $_[1] ) eq 'Regexp'; my ( $self, $test ) = @_; for (@$self) { return unless $_ != $test; } return 1; } sub num_ge { my ( $self, $test, $switch ) = @_; return num_le( $self, $test ) if $switch; for (@$self) { return unless $_ >= $test; } return 1; } sub num_gt { my ( $self, $test, $switch ) = @_; return num_lt( $self, $test ) if $switch; for (@$self) { return unless $_ > $test; } return 1; } sub num_le { my ( $self, $test, $switch ) = @_; return num_ge( $self, $test ) if $switch; for (@$self) { return unless $_ <= $test; } return 1; } sub num_lt { my ( $self, $test, $switch ) = @_; return num_gt( $self, $test ) if $switch; for (@$self) { return unless $_ < $test; } return 1; } sub str_eq { my ( $self, $test ) = @_; for (@$self) { return unless $_ eq $test; } return 1; } sub str_ne { my ( $self, $test ) = @_; for (@$self) { return unless $_ ne $test; } return 1; } sub str_ge { my ( $self, $test, $switch ) = @_; return str_le( $self, $test ) if $switch; for (@$self) { return unless $_ ge $test; } return 1; } sub str_gt { my ( $self, $test, $switch ) = @_; return str_lt( $self, $test ) if $switch; for (@$self) { return unless $_ gt $test; } return 1; } sub str_le { my ( $self, $test, $switch ) = @_; return str_ge( $self, $test ) if $switch; for (@$self) { return unless $_ le $test; } return 1; } sub str_lt { my ( $self, $test, $switch ) = @_; return str_gt( $self, $test ) if $switch; for (@$self) { return unless $_ lt $test; } return 1; } sub regex_eq { my ( $self, $test, $switch ) = @_; for (@$self) { return unless $_ =~ $test; } return 1; } sub regex_ne { my ( $self, $test, $switch ) = @_; for (@$self) { return unless $_ !~ $test; } return 1; } sub bool { my ($self) = @_; for (@$self) { return unless $_; } return 1; } 1; __END__ =pod =encoding UTF-8 =for :stopwords Arthur Axel "fREW" Schmidt Carl Franks =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHORS =over 4 =item * Arthur Axel "fREW" Schmidt =item * Carl Franks =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2024 by Arthur Axel "fREW" Schmidt. 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 libsyntax-keyword-junction-perl-0.003009/lib/Syntax/Keyword/Junction/Any.pm000066400000000000000000000072531466224114100266010ustar00rootroot00000000000000package Syntax::Keyword::Junction::Any; use strict; use warnings; our $VERSION = '0.003009'; use parent 'Syntax::Keyword::Junction::Base'; BEGIN { if (Syntax::Keyword::Junction::Base::_WANT_SMARTMATCH) { eval '#line '.(__LINE__+1).' "' . __FILE__.qq["\n] . <<'END_CODE' or die $@; no if Syntax::Keyword::Junction::Base::_SMARTMATCH_WARNING_CATEGORY, warnings => Syntax::Keyword::Junction::Base::_SMARTMATCH_WARNING_CATEGORY; sub match { my ( $self, $other, $is_rhs ) = @_; if ($is_rhs) { for (@$self) { return 1 if $other ~~ $_; } return; } for (@$self) { return 1 if $_ ~~ $other; } return; } 1; END_CODE } } sub num_eq { return regex_eq(@_) if ref( $_[1] ) eq 'Regexp'; my ( $self, $test ) = @_; for (@$self) { return 1 if $_ == $test; } return; } sub num_ne { return regex_ne(@_) if ref( $_[1] ) eq 'Regexp'; my ( $self, $test ) = @_; for (@$self) { return 1 if $_ != $test; } return; } sub num_ge { my ( $self, $test, $switch ) = @_; return num_le( $self, $test ) if $switch; for (@$self) { return 1 if $_ >= $test; } return; } sub num_gt { my ( $self, $test, $switch ) = @_; return num_lt( $self, $test ) if $switch; for (@$self) { return 1 if $_ > $test; } return; } sub num_le { my ( $self, $test, $switch ) = @_; return num_ge( $self, $test ) if $switch; for (@$self) { return 1 if $_ <= $test; } return; } sub num_lt { my ( $self, $test, $switch ) = @_; return num_gt( $self, $test ) if $switch; for (@$self) { return 1 if $_ < $test; } return; } sub str_eq { my ( $self, $test ) = @_; for (@$self) { return 1 if $_ eq $test; } return; } sub str_ne { my ( $self, $test ) = @_; for (@$self) { return 1 if $_ ne $test; } return; } sub str_ge { my ( $self, $test, $switch ) = @_; return str_le( $self, $test ) if $switch; for (@$self) { return 1 if $_ ge $test; } return; } sub str_gt { my ( $self, $test, $switch ) = @_; return str_lt( $self, $test ) if $switch; for (@$self) { return 1 if $_ gt $test; } return; } sub str_le { my ( $self, $test, $switch ) = @_; return str_ge( $self, $test ) if $switch; for (@$self) { return 1 if $_ le $test; } return; } sub str_lt { my ( $self, $test, $switch ) = @_; return str_gt( $self, $test ) if $switch; for (@$self) { return 1 if $_ lt $test; } return; } sub regex_eq { my ( $self, $test, $switch ) = @_; for (@$self) { return 1 if $_ =~ $test; } return; } sub regex_ne { my ( $self, $test, $switch ) = @_; for (@$self) { return 1 if $_ !~ $test; } return; } sub bool { my ($self) = @_; for (@$self) { return 1 if $_; } return; } 1; __END__ =pod =encoding UTF-8 =for :stopwords Arthur Axel "fREW" Schmidt Carl Franks =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHORS =over 4 =item * Arthur Axel "fREW" Schmidt =item * Carl Franks =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2024 by Arthur Axel "fREW" Schmidt. 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 libsyntax-keyword-junction-perl-0.003009/lib/Syntax/Keyword/Junction/Base.pm000066400000000000000000000033541466224114100267220ustar00rootroot00000000000000package Syntax::Keyword::Junction::Base; use strict; use warnings; our $VERSION = '0.003009'; BEGIN { *_WANT_SMARTMATCH = ("$]" >= 5.010001 && "$]" < 5.041000) ? sub(){1} : sub(){0}; my $category = "$]" >= 5.041000 ? undef : "$]" >= 5.037011 ? 'deprecated::smartmatch' : "$]" >= 5.017011 ? 'experimental::smartmatch' : undef; *_SMARTMATCH_WARNING_CATEGORY = sub(){$category}; } use overload( '==' => "num_eq", '!=' => "num_ne", '>=' => "num_ge", '>' => "num_gt", '<=' => "num_le", '<' => "num_lt", 'eq' => "str_eq", 'ne' => "str_ne", 'ge' => "str_ge", 'gt' => "str_gt", 'le' => "str_le", 'lt' => "str_lt", 'bool' => "bool", '""' => sub {shift}, ('~~' => 'match') x!! _WANT_SMARTMATCH, ); sub new { bless \@_, shift } sub values { my $self = shift; return wantarray ? @$self : [ @$self ]; } sub map { my ( $self, $code ) = @_; my $class = ref $self; $class->new( map { $code->( $_ ) } $self->values ); } 1; __END__ =pod =encoding UTF-8 =for :stopwords Arthur Axel "fREW" Schmidt Carl Franks =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHORS =over 4 =item * Arthur Axel "fREW" Schmidt =item * Carl Franks =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2024 by Arthur Axel "fREW" Schmidt. 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 libsyntax-keyword-junction-perl-0.003009/lib/Syntax/Keyword/Junction/None.pm000066400000000000000000000072541466224114100267520ustar00rootroot00000000000000package Syntax::Keyword::Junction::None; use strict; use warnings; our $VERSION = '0.003009'; use parent 'Syntax::Keyword::Junction::Base'; BEGIN { if (Syntax::Keyword::Junction::Base::_WANT_SMARTMATCH) { eval '#line '.(__LINE__+1).' "' . __FILE__.qq["\n] . <<'END_CODE' or die $@; no if Syntax::Keyword::Junction::Base::_SMARTMATCH_WARNING_CATEGORY, warnings => Syntax::Keyword::Junction::Base::_SMARTMATCH_WARNING_CATEGORY; sub match { my ( $self, $other, $is_rhs ) = @_; if ($is_rhs) { for (@$self) { return if $other ~~ $_; } return 1; } for (@$self) { return if $_ ~~ $other; } return 1; } 1; END_CODE } } sub num_eq { return regex_eq(@_) if ref( $_[1] ) eq 'Regexp'; my ( $self, $test ) = @_; for (@$self) { return if $_ == $test; } return 1; } sub num_ne { return regex_ne(@_) if ref( $_[1] ) eq 'Regexp'; my ( $self, $test ) = @_; for (@$self) { return if $_ != $test; } return 1; } sub num_ge { my ( $self, $test, $switch ) = @_; return num_le( $self, $test ) if $switch; for (@$self) { return if $_ >= $test; } return 1; } sub num_gt { my ( $self, $test, $switch ) = @_; return num_lt( $self, $test ) if $switch; for (@$self) { return if $_ > $test; } return 1; } sub num_le { my ( $self, $test, $switch ) = @_; return num_ge( $self, $test ) if $switch; for (@$self) { return if $_ <= $test; } return 1; } sub num_lt { my ( $self, $test, $switch ) = @_; return num_gt( $self, $test ) if $switch; for (@$self) { return if $_ < $test; } return 1; } sub str_eq { my ( $self, $test ) = @_; for (@$self) { return if $_ eq $test; } return 1; } sub str_ne { my ( $self, $test ) = @_; for (@$self) { return if $_ ne $test; } return 1; } sub str_ge { my ( $self, $test, $switch ) = @_; return str_le( $self, $test ) if $switch; for (@$self) { return if $_ ge $test; } return 1; } sub str_gt { my ( $self, $test, $switch ) = @_; return str_lt( $self, $test ) if $switch; for (@$self) { return if $_ gt $test; } return 1; } sub str_le { my ( $self, $test, $switch ) = @_; return str_ge( $self, $test ) if $switch; for (@$self) { return if $_ le $test; } return 1; } sub str_lt { my ( $self, $test, $switch ) = @_; return str_gt( $self, $test ) if $switch; for (@$self) { return if $_ lt $test; } return 1; } sub regex_eq { my ( $self, $test, $switch ) = @_; for (@$self) { return if $_ =~ $test; } return 1; } sub regex_ne { my ( $self, $test, $switch ) = @_; for (@$self) { return if $_ !~ $test; } return 1; } sub bool { my ($self) = @_; for (@$self) { return if $_; } return 1; } 1; __END__ =pod =encoding UTF-8 =for :stopwords Arthur Axel "fREW" Schmidt Carl Franks =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHORS =over 4 =item * Arthur Axel "fREW" Schmidt =item * Carl Franks =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2024 by Arthur Axel "fREW" Schmidt. 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 libsyntax-keyword-junction-perl-0.003009/lib/Syntax/Keyword/Junction/One.pm000066400000000000000000000122631466224114100265700ustar00rootroot00000000000000package Syntax::Keyword::Junction::One; use strict; use warnings; our $VERSION = '0.003009'; use parent 'Syntax::Keyword::Junction::Base'; BEGIN { if (Syntax::Keyword::Junction::Base::_WANT_SMARTMATCH) { eval '#line '.(__LINE__+1).' "' . __FILE__.qq["\n] . <<'END_CODE' or die $@; no if Syntax::Keyword::Junction::Base::_SMARTMATCH_WARNING_CATEGORY, warnings => Syntax::Keyword::Junction::Base::_SMARTMATCH_WARNING_CATEGORY; sub match { my ( $self, $other, $is_rhs ) = @_; my $count = 0; if ($is_rhs) { for (@$self) { if ($other ~~ $_) { return if $count; $count = 1; } } return($count == 1); } for (@$self) { if ($_ ~~ $other) { return if $count; $count = 1; } } return($count == 1); } 1; END_CODE } } sub num_eq { return regex_eq(@_) if ref( $_[1] ) eq 'Regexp'; my ( $self, $test ) = @_; my $count = 0; for (@$self) { if ( $_ == $test ) { return if $count; $count = 1; } } return 1 if $count; } sub num_ne { return regex_ne(@_) if ref( $_[1] ) eq 'Regexp'; my ( $self, $test ) = @_; my $count = 0; for (@$self) { if ( $_ != $test ) { return if $count; $count = 1; } } return 1 if $count; } sub num_ge { my ( $self, $test, $switch ) = @_; return num_le( $self, $test ) if $switch; my $count = 0; for (@$self) { if ( $_ >= $test ) { return if $count; $count = 1; } } return 1 if $count; } sub num_gt { my ( $self, $test, $switch ) = @_; return num_lt( $self, $test ) if $switch; my $count = 0; for (@$self) { if ( $_ > $test ) { return if $count; $count = 1; } } return 1 if $count; } sub num_le { my ( $self, $test, $switch ) = @_; return num_ge( $self, $test ) if $switch; my $count = 0; for (@$self) { if ( $_ <= $test ) { return if $count; $count = 1; } } return 1 if $count; } sub num_lt { my ( $self, $test, $switch ) = @_; return num_gt( $self, $test ) if $switch; my $count = 0; for (@$self) { if ( $_ < $test ) { return if $count; $count = 1; } } return 1 if $count; } sub str_eq { my ( $self, $test ) = @_; my $count = 0; for (@$self) { if ( $_ eq $test ) { return if $count; $count = 1; } } return 1 if $count; } sub str_ne { my ( $self, $test ) = @_; my $count = 0; for (@$self) { if ( $_ ne $test ) { return if $count; $count = 1; } } return 1 if $count; } sub str_ge { my ( $self, $test, $switch ) = @_; return str_le( $self, $test ) if $switch; my $count = 0; for (@$self) { if ( $_ ge $test ) { return if $count; $count = 1; } } return 1 if $count; } sub str_gt { my ( $self, $test, $switch ) = @_; return str_lt( $self, $test ) if $switch; my $count = 0; for (@$self) { if ( $_ gt $test ) { return if $count; $count = 1; } } return 1 if $count; } sub str_le { my ( $self, $test, $switch ) = @_; return str_ge( $self, $test ) if $switch; my $count = 0; for (@$self) { if ( $_ le $test ) { return if $count; $count = 1; } } return 1 if $count; } sub str_lt { my ( $self, $test, $switch ) = @_; return str_gt( $self, $test ) if $switch; my $count = 0; for (@$self) { if ( $_ lt $test ) { return if $count; $count = 1; } } return 1 if $count; } sub regex_eq { my ( $self, $test, $switch ) = @_; my $count = 0; for (@$self) { if ( $_ =~ $test ) { return if $count; $count = 1; } } return 1 if $count; } sub regex_ne { my ( $self, $test, $switch ) = @_; my $count = 0; for (@$self) { if ( $_ !~ $test ) { return if $count; $count = 1; } } return 1 if $count; } sub bool { my ($self) = @_; my $count = 0; for (@$self) { if ($_) { return if $count; $count = 1; } } return 1 if $count; } 1; __END__ =pod =encoding UTF-8 =for :stopwords Arthur Axel "fREW" Schmidt Carl Franks =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHORS =over 4 =item * Arthur Axel "fREW" Schmidt =item * Carl Franks =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2024 by Arthur Axel "fREW" Schmidt. 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 libsyntax-keyword-junction-perl-0.003009/t/000077500000000000000000000000001466224114100204775ustar00rootroot00000000000000libsyntax-keyword-junction-perl-0.003009/t/00-compile.t000066400000000000000000000032121466224114100225270ustar00rootroot00000000000000use 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058 use Test::More; plan tests => 7 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Syntax/Feature/Junction.pm', 'Syntax/Keyword/Junction.pm', 'Syntax/Keyword/Junction/All.pm', 'Syntax/Keyword/Junction/Any.pm', 'Syntax/Keyword/Junction/Base.pm', 'Syntax/Keyword/Junction/None.pm', 'Syntax/Keyword/Junction/One.pm' ); # no fake home requested my @switches = ( -d 'blib' ? '-Mblib' : '-Ilib', ); use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } $^X, @switches, '-e', "require q[$lib]")) if $ENV{PERL_COMPILE_TEST_DEBUG}; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { +require blib; blib->VERSION('1.01') }; if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING}; libsyntax-keyword-junction-perl-0.003009/t/00-report-prereqs.dd000066400000000000000000000040041466224114100242150ustar00rootroot00000000000000do { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '0' }, 'suggests' => { 'JSON::PP' => '2.27300' } }, 'develop' => { 'requires' => { 'Test::CPAN::Changes' => '0.19', 'Test::CPAN::Meta' => '0', 'Test::EOL' => '0', 'Test::Mojibake' => '0', 'Test::More' => '0.88', 'Test::NoTabs' => '0', 'Test::Pod' => '1.41', 'Test::Portability::Files' => '0', 'Test::Spelling' => '0.12', 'Test::Version' => '1' } }, 'runtime' => { 'requires' => { 'Sub::Exporter::Progressive' => '0.001006', 'parent' => '0', 'perl' => '5.006' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900' }, 'requires' => { 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'IO::Handle' => '0', 'IPC::Open3' => '0', 'Test::More' => '0.88', 'Test::Needs' => '0.002006' } } }; $x; }libsyntax-keyword-junction-perl-0.003009/t/00-report-prereqs.t000066400000000000000000000136011466224114100240740ustar00rootroot00000000000000#!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.029 use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec; # from $version::LAX my $lax_version_re = qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? | (?:\.[0-9]+) (?:_[0-9]+)? ) | (?: v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? | (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? ) )/x; # hide optional CPAN::Meta modules from prereq scanner # and check if they are available my $cpan_meta = "CPAN::Meta"; my $cpan_meta_pre = "CPAN::Meta::Prereqs"; my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic # Verify requirements? my $DO_VERIFY_PREREQS = 1; sub _max { my $max = shift; $max = ( $_ > $max ) ? $_ : $max for @_; return $max; } sub _merge_prereqs { my ($collector, $prereqs) = @_; # CPAN::Meta::Prereqs object if (ref $collector eq $cpan_meta_pre) { return $collector->with_merged_prereqs( CPAN::Meta::Prereqs->new( $prereqs ) ); } # Raw hashrefs for my $phase ( keys %$prereqs ) { for my $type ( keys %{ $prereqs->{$phase} } ) { for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; } } } return $collector; } my @include = qw( ); my @exclude = qw( ); # Add static prereqs to the included modules list my $static_prereqs = do './t/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), $static_prereqs ); # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; my $cpan_meta_error; if ( $source && $HAS_CPAN_META && (my $meta = eval { CPAN::Meta->load_file($source) } ) ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } else { $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source) $source = 'static metadata'; } my @full_reports; my @dep_errors; my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; # Add static includes into a fake section for my $mod (@include) { $req_hash->{other}{modules}{$mod} = 0; } for my $phase ( qw(configure build test runtime develop other) ) { next unless $req_hash->{$phase}; next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); for my $type ( qw(requires recommends suggests conflicts modules) ) { next unless $req_hash->{$phase}{$type}; my $title = ucfirst($phase).' '.ucfirst($type); my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { next if grep { $_ eq $mod } @exclude; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; if ($mod eq 'perl') { push @reports, ['perl', $want, $]]; next; } my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; push @reports, [$mod, $want, $have]; if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { if ( $have !~ /\A$lax_version_re\z/ ) { push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; } elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { push @dep_errors, "$mod version '$have' is not in required range '$want'"; } } } else { push @reports, [$mod, $want, "missing"]; if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { push @dep_errors, "$mod is not installed ($req_string)"; } } } if ( @reports ) { push @full_reports, "=== $title ===\n\n"; my $ml = _max( map { length $_->[0] } @reports ); my $wl = _max( map { length $_->[1] } @reports ); my $hl = _max( map { length $_->[2] } @reports ); if ($type eq 'modules') { splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; } else { splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; } push @full_reports, "\n"; } } } if ( @full_reports ) { diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } if ( $cpan_meta_error || @dep_errors ) { diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n"; } if ( $cpan_meta_error ) { my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n"; } if ( @dep_errors ) { diag join("\n", "\nThe following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass('Reported prereqs'); # vim: ts=4 sts=4 sw=4 et: libsyntax-keyword-junction-perl-0.003009/t/01_use.t000066400000000000000000000001331466224114100217550ustar00rootroot00000000000000use strict; use warnings; use Test::More tests => 1; use_ok('Syntax::Keyword::Junction'); libsyntax-keyword-junction-perl-0.003009/t/all.t000066400000000000000000000107401466224114100214360ustar00rootroot00000000000000use strict; use warnings; use Test::More tests => 91; use Syntax::Keyword::Junction 'all'; ok( all( 3, 3.0 ) == 3, '==' ); ok( all( 3, 3 ) == 3, '==' ); ok( all( 3, 3.0, 3 ) == 3, '==' ); ok( not( all( 2, 3.0 ) == 3 ), '== negated' ); ok( not( all( 2, 2.0, 3 ) == 3 ), '== negated' ); ok( not( all( 2, 3, 3.0 ) == 3 ), '== negated' ); ok( all( 3, 4, 5 ) != 2, '!=' ); ok( all( 3, 3, 5 ) != 2, '!=' ); ok( all( 3, 3, 3.0 ) != 2, '!=' ); ok( not( all( 3, 4, 5 ) != 3 ), '!= negated' ); ok( not( all( 3, 3.0 ) != 3 ), '!= negated' ); ok( all( 3, 4, 5 ) >= 2, '>=' ); ok( all( 3, 4, 5 ) >= 3, '>=' ); ok( not( all( 3, 4, 5 ) >= 4 ), '>= negated' ); ok( not( all( 3, 4, 5 ) >= 5 ), '>= negated' ); ok( not( all( 3, 5, 6 ) >= 4 ), '>= negated' ); ok( 6 >= all( 3, 4, 5 ), '>= switched' ); ok( 5 >= all( 3, 4, 5 ), '>= switched' ); ok( not( 2 >= all( 3, 4, 5 ) ), '>= negated switched' ); ok( not( 3 >= all( 3, 4, 5 ) ), '>= negated switched' ); ok( not( 4 >= all( 3, 4, 5 ) ), '>= negated switched' ); ok( not( 4 >= all( 3, 5, 6 ) ), '>= negated switched' ); ok( all( 3, 4, 5 ) > 2, '>' ); ok( not( all( 3, 4, 5 ) > 4 ), '> negated' ); ok( not( all( 3, 4, 5 ) > 5 ), '> negated' ); ok( not( all( 3, 4, 5 ) > 6 ), '> negated' ); ok( 6 > all( 3, 4, 5 ), '> switched' ); ok( not( 5 > all( 3, 4, 5 ) ), '> negated switched' ); ok( not( 4 > all( 3, 4, 5 ) ), '> negated switched' ); ok( not( 3 > all( 3, 4, 5 ) ), '> negated switched' ); ok( not( 2 > all( 3, 4, 5 ) ), '> negated switched' ); ok( all( 3, 4, 5 ) <= 5, '<=' ); ok( all( 3, 4, 5 ) <= 6, '<=' ); ok( not( all( 3, 4, 5 ) <= 2 ), '<= negated' ); ok( 2 <= all( 3, 4, 5 ), '<= switched' ); ok( 3 <= all( 3, 4, 5 ), '<= switched' ); ok( not( 6 <= all( 3, 4, 5 ) ), '<= negated switched' ); ok( all( 3, 4, 5 ) < 6, '<' ); ok( not( all( 3, 4, 5 ) < 5 ), '< negated' ); ok( not( all( 3, 4, 5 ) < 2 ), '< negated' ); ok( 2 < all( 3, 4, 5 ), '< switched' ); ok( not( 5 < all( 3, 4, 5 ) ), '< negated switched' ); ok( not( 6 < all( 3, 4, 5 ) ), '< negated switched' ); ok( all( 'g', 'g' ) eq 'g', 'eq' ); ok( not( all( 'g', 'h' ) eq 'g' ), 'eq negated' ); ok( all( 'h', 'i' ) ne 'g', 'ne' ); ok( not( all( 'h', 'i' ) ne 'i' ), 'ne negated' ); ok( all( 'g', 'h' ) ge 'g', 'ge' ); ok( all( 'g', 'h' ) ge 'f', 'ge' ); ok( not( all( 'g', 'h' ) ge 'i' ), 'ge negated' ); ok( 'i' ge all( 'g', 'h' ), 'ge switched' ); ok( 'h' ge all( 'g', 'h' ), 'ge switched' ); ok( not( 'f' ge all( 'g', 'h' ) ), 'ge negated switched' ); ok( all( 'g', 'h' ) gt 'f', 'gt' ); ok( not( all( 'a', 'h' ) gt 'e' ), 'gt negated' ); ok( not( all( 'g', 'h' ) gt 'g' ), 'gt negated' ); ok( 'i' gt all( 'g', 'h' ), 'gt switched' ); ok( not( 'f' gt all( 'g', 'h' ) ), 'gt negated switched' ); ok( not( 'g' gt all( 'g', 'h' ) ), 'gt negated switched' ); ok( all( 'g', 'h' ) le 'i', 'le' ); ok( all( 'g', 'h' ) le 'h', 'le' ); ok( not( all( 'g', 'h' ) le 'f' ), 'le negated' ); ok( 'f' le all( 'g', 'h' ), 'le switched' ); ok( 'g' le all( 'g', 'h' ), 'le switched' ); ok( not( 'i' le all( 'g', 'h' ) ), 'le negated switched' ); ok( all( 'g', 'h' ) lt 'i', 'lt' ); ok( not( all( 'b', 'h' ) lt 'a' ), 'lt negated' ); ok( not( all( 'g', 'h' ) lt 'f' ), 'lt negated' ); ok( 'f' lt all( 'g', 'h' ), 'lt switched' ); ok( not( 'h' lt all( 'g', 'h' ) ), 'lt negated switched' ); ok( not( 'i' lt all( 'g', 'h' ) ), 'lt negated switched' ); ok( all( 3, 40 ) == qr/\d+/, '== regex' ); ok( qr/^[ab]$/ == all( 'a', 'b' ), '== regex' ); ok( not( all( 2, 3, 'c' ) == qr/\d+/ ), '== regex negated' ); ok( not( qr/\d/ == all( 2, 3, 'c' ) ), '== regex negated' ); ok( not( qr/[a-z]+/ == all( 'a', 'b', 3 ) ), '== regex negated' ); ok( all( 3, 4, 5 ) != qr/[a-z]/, '!= regex' ); ok( all( 'a', 'b', 'c' ) != qr/\d/, '!= regex' ); ok( not( all( 3, 4, 5 ) != qr/4/ ), '!= regex negated' ); ok( not( all( 3, 4, 'a' ) != qr/[a-z]/ ), '!= regex negated' ); ok( all( 3, 3.0 ), 'bool' ); ok( all( 3, 3 ), 'bool' ); ok( all( 3, 3.0, 3 ), 'bool' ); ok( !all( 2, 0 ), '! bool' ); ok( !all( '', 'a' ), '! bool' ); ok( !all( 'a', undef, 'c' ), '! bool' ); like( all( 1, 2 ), qr/^Syntax::Keyword::Junction::All=/, 'stringified to ref' ); my @data = qw(3 4 5 6 7); my $junction = all(@data); can_ok $junction, 'values'; my @values = $junction->values; is_deeply \@values, \@data, 'values() in list context'; my $values = $junction->values; is_deeply $values, \@data, 'values() in scalar context'; my $plus1 = $junction->map( sub { $_ + 1 } ); is_deeply( [ $plus1->values ], [ qw( 4 5 6 7 8 ) ], "map method"); libsyntax-keyword-junction-perl-0.003009/t/any.t000066400000000000000000000072211466224114100214550ustar00rootroot00000000000000use strict; use warnings; use Test::More tests => 76; use Syntax::Keyword::Junction 'any'; ok( any( 2, 3.0 ) == 2, '==' ); ok( any( 2, 3.0 ) == 3, '==' ); ok( not( any( 2, 3.0 ) == 4 ), '== negated' ); ok( any( 3, 4.0 ) != 4, '!=' ); ok( any( 4, 5.0 ) != 4, '!=' ); ok( not( any( 3, 3.0 ) != 3 ), '!= negated' ); ok( any( 3, 4, 5 ) >= 5, '>=' ); ok( any( 3, 4, 5 ) >= 2, '>=' ); ok( not( any( 3, 4, 5 ) >= 6 ), '>= negated' ); ok( 6 >= any( 3, 4, 5 ), '>= switched' ); ok( 3 >= any( 3, 4, 5 ), '>= switched' ); ok( not( 2 >= any( 3, 4, 5 ) ), '>= negated switched' ); ok( any( 3, 4, 5 ) > 2, '>' ); ok( any( 3, 4, 5 ) > 3, '>' ); ok( not( any( 3, 4, 5 ) > 6 ), '> negated' ); ok( 6 > any( 3, 4, 5 ), '> switched' ); ok( 4 > any( 3, 4, 5 ), '> switched' ); ok( not( 2 > any( 3, 4, 5 ) ), '> negated switched' ); ok( any( 3, 4, 5 ) <= 5, '<=' ); ok( any( 3, 4, 5 ) <= 6, '<=' ); ok( not( any( 3, 4, 5 ) <= 2 ), '<= negated' ); ok( 5 <= any( 3, 4, 5 ), '<= switched' ); ok( 2 <= any( 3, 4, 5 ), '<= switched' ); ok( not( 6 <= any( 3, 4, 5 ) ), '<= negated switched' ); ok( any( 3, 4, 5 ) < 6, '<' ); ok( any( 5, 4, 3 ) < 4, '<' ); ok( not( any( 3, 4, 5 ) < 2 ), '< negated' ); ok( 2 < any( 3, 4, 5 ), '< switched' ); ok( 4 < any( 3, 4, 5 ), '< switched' ); ok( not( 6 < any( 3, 4, 5 ) ), '< negated switched' ); ok( any( 'g', 'h' ) eq 'g', 'eq' ); ok( any( 'g', 'g' ) eq 'g', 'eq' ); ok( not( any( 'g', 'h' ) eq 'i' ), 'eq negated' ); ok( any( 'g', 'h' ) ne 'g', 'ne' ); ok( not( any( 'i', 'i' ) ne 'i' ), 'ne negated' ); ok( any( 'g', 'h' ) ge 'f', 'ge' ); ok( any( 'g', 'h' ) ge 'g', 'ge' ); ok( not( any( 'g', 'h' ) ge 'i' ), 'ge negated' ); ok( 'i' ge any( 'g', 'h' ), 'ge switched' ); ok( 'g' ge any( 'g', 'f' ), 'ge switched' ); ok( not( 'f' ge any( 'g', 'h' ) ), 'ge negated switched' ); ok( any( 'g', 'h' ) gt 'f', 'gt' ); ok( any( 'g', 'h' ) gt 'g', 'gt' ); ok( not( any( 'g', 'h' ) gt 'i' ), 'gt negated' ); ok( 'i' gt any( 'h', 'g' ), 'gt switched' ); ok( 'h' gt any( 'h', 'g' ), 'gt switched' ); ok( not( 'g' gt any( 'g', 'h' ) ), 'gt negated switched' ); ok( not( 'f' gt any( 'g', 'h' ) ), 'gt negated switched' ); ok( any( 'g', 'h' ) le 'i', 'le' ); ok( any( 'g', 'f' ) le 'g', 'le' ); ok( not( any( 'g', 'h' ) le 'f' ), 'le negated' ); ok( 'f' le any( 'g', 'h' ), 'le switched' ); ok( 'g' le any( 'h', 'g' ), 'le switched' ); ok( not( 'i' le any( 'g', 'h' ) ), 'le negated switched' ); ok( any( 'g', 'h' ) lt 'i', 'lt' ); ok( any( 'h', 'g' ) lt 'h', 'lt' ); ok( not( any( 'g', 'h' ) lt 'f' ), 'lt negated' ); ok( 'f' lt any( 'g', 'h' ), 'lt switched' ); ok( 'g' lt any( 'h', 'g' ), 'lt switched' ); ok( not( 'i' lt any( 'g', 'h' ) ), 'lt negated switched' ); ok( any( 3, 'b' ) == qr/\d+/, '== regex' ); ok( qr/^[ab]$/ == any( 'a', 4 ), '== regex' ); ok( not( any( 'a', 'b', 'c' ) == qr/\d+/ ), '== regex negated' ); ok( not( qr/\d/ == any( 'a', 'b', 'c' ) ), '== regex negated' ); ok( not( qr/[a-z]/ == any( 3, 4, 5 ) ), '== regex negated' ); ok( any( 3, 4, 'a' ) != qr/\d/, '!= regex' ); ok( any( 3, 4, '5.0' ) != qr/^\d+$/, '!= regex' ); ok( not( any( 3, 4, 5 ) != qr/\d/ ), '!= regex negated' ); ok( any( 2, 0 ), 'bool' ); ok( any( '', 'a' ), 'bool' ); ok( !any( undef, 0 ), '! bool' ); like( any( 1, 2 ), qr/^Syntax::Keyword::Junction::Any=/, 'stringified to ref' ); my @data = qw(3 4 5 6 7); my $junction = any(@data); can_ok $junction, 'values'; my @values = $junction->values; is_deeply \@values, \@data, 'values() in list context'; my $values = $junction->values; is_deeply $values, \@data, 'values() in scalar context'; my $plus1 = $junction->map( sub { $_ + 1 } ); is_deeply( [ $plus1->values ], [ qw( 4 5 6 7 8 ) ], "map method"); libsyntax-keyword-junction-perl-0.003009/t/import_tags.t000066400000000000000000000003341466224114100232140ustar00rootroot00000000000000use strict; use warnings; use Test::More tests => 4; use Syntax::Keyword::Junction ':ALL'; ok( all( 3, 3.0 ) == 3, '==' ); ok( any( 2, 3.0 ) == 2, '==' ); ok( none( 2, 3.0 ) == 4, '==' ); ok( one( 2, 3 ) == 2, '==' ); libsyntax-keyword-junction-perl-0.003009/t/join.t000066400000000000000000000021231466224114100216210ustar00rootroot00000000000000use strict; use warnings; use Test::More tests => 21; use Syntax::Keyword::Junction ':ALL'; ok( all( 3, 3.0 ) == all( 3, 3.0 ), '==' ); ok( all( 3, 3.0 ) == any( 3, 3.0 ), '==' ); ok( any( 3, 3.0 ) == all( 3, 3.0 ), '==' ); ok( all( 1, 3.0 ) == none( 2, 4, 5 ), '==' ); ok( none( 5, 6, 8 ) == all( 5, 6, 8 ), '==' ); ok( all( 1, 3.0 ) == one( 1, 3 ), '==' ); ok( one( 5, 6 ) == all( 5, 5, 5 ), '==' ); ok( not( all( 2, 3 ) == all( 2, 3 ) ), '== negated' ); ok( not( all( 2, 3 ) == any( 4, 5 ) ), '== negated' ); ok( not( any( 2, 3 ) == all( 2, 3 ) ), '== negated' ); ok( not( all( 2, 3 ) == none( 2, 3 ) ), '== negated' ); ok( not( none( 2, 3 ) == all( 2, 2 ) ), '== negated' ); ok( not( all( 2, 3 ) == one( 2, 2 ) ), '== negated' ); ok( not( one( 2, 3 ) == all( 2, 3 ) ), '== negated' ); ok( all( 3, 4, 5 ) >= all( 2, 3 ), '>=' ); ok( all( 5, 10, 15 ) > any( 3, 5, -1, 2 ), '>=' ); ok( any( 3, 4, 5 ) >= all( 3, 4, 5 ), '>=' ); ok( all( 1, 3.0 ) >= none( 4, 5, 6 ), '>=' ); ok( none( 5, 6, 8 ) >= all( 9, 10 ), '>=' ); ok( all( 3, 4 ) >= one( 3, 6 ), '>=' ); ok( one( 4, 5 ) >= all( 5, 5, 5 ), '>=' ); libsyntax-keyword-junction-perl-0.003009/t/no_import.t000066400000000000000000000005011466224114100226660ustar00rootroot00000000000000use strict; use warnings; use Test::More tests => 4; use Syntax::Keyword::Junction; ok( Syntax::Keyword::Junction::all( 3, 3.0 ) == 3, '==' ); ok( Syntax::Keyword::Junction::any( 2, 3.0 ) == 2, '==' ); ok( Syntax::Keyword::Junction::none( 2, 3.0 ) == 4, '==' ); ok( Syntax::Keyword::Junction::one( 2, 3 ) == 2, '==' ); libsyntax-keyword-junction-perl-0.003009/t/none.t000066400000000000000000000104071466224114100216250ustar00rootroot00000000000000use strict; use warnings; use Test::More tests => 82; use Syntax::Keyword::Junction 'none'; ok( none( 2, 3.0 ) == 4, '==' ); ok( not( none( 2, 3.0 ) == 3 ), '== negated' ); ok( none( 4, 4.0 ) != 4, '!=' ); ok( not( none( 3, 4, 5 ) != 6 ), '!= negated' ); ok( none( 3, 4, 5 ) >= 6, '>=' ); ok( not( none( 3, 4, 5 ) >= 4 ), '>= negated' ); ok( not( none( 3, 4, 5 ) >= 2 ), '>= negated' ); ok( 2 >= none( 3, 4, 5 ), '>= switched' ); ok( not( 6 >= none( 3, 4, 5 ) ), '>= negated switched' ); ok( not( 3 >= none( 3, 4, 5 ) ), '>= negated switched' ); ok( none( 3, 4, 5 ) > 6, '>' ); ok( none( 3, 4, 5 ) > 5, '>' ); ok( not( none( 3, 4, 5 ) > 3 ), '> negated' ); ok( not( none( 3, 4, 5 ) > 2 ), '> negated' ); ok( 2 > none( 3, 4, 5 ), '> switched' ); ok( 3 > none( 3, 4, 5 ), '> switched' ); ok( not( 5 > none( 3, 4, 5 ) ), '> negated switched' ); ok( not( 6 > none( 3, 4, 5 ) ), '> negated switched' ); ok( none( 3, 4, 5 ) <= 2, '<=' ); ok( not( none( 3, 4, 5 ) <= 5 ), '<= negated' ); ok( not( none( 3, 4, 5 ) <= 6 ), '<= negated' ); ok( 6 <= none( 3, 4, 5 ), '<= switched' ); ok( not( 2 <= none( 3, 4, 5 ) ), '<= negated switched' ); ok( not( 4 <= none( 3, 4, 5 ) ), '<= negated switched' ); ok( not( 5 <= none( 3, 4, 5 ) ), '<= negated switched' ); ok( none( 3, 4, 5 ) < 3, '<' ); ok( none( 3, 4, 5 ) < 2, '<' ); ok( not( none( 3, 4, 5 ) < 5 ), '< negated' ); ok( not( none( 3, 4, 5 ) < 6 ), '< negated' ); ok( 6 < none( 3, 4, 5 ), '< switched' ); ok( 5 < none( 3, 4, 5 ), '< switched' ); ok( not( 2 < none( 3, 4, 5 ) ), '< negated switched' ); ok( not( 3 < none( 3, 4, 5 ) ), '< negated switched' ); ok( not( 4 < none( 3, 4, 5 ) ), '< negated switched' ); ok( none( 'g', 'h' ) eq 'i', 'eq' ); ok( not( none( 'g', 'h' ) eq 'g' ), 'eq negated' ); ok( not( none( 'g', 'g' ) eq 'g' ), 'eq negated' ); ok( none( 'h', 'h' ) ne 'h', 'ne' ); ok( not( none( 'h', 'i' ) ne 'i' ), 'ne negated' ); ok( not( none( 'i', 'i' ) ne 'j' ), 'ne negated' ); ok( none( 'g', 'h' ) ge 'i', 'ge' ); ok( not( none( 'g', 'h' ) ge 'g' ), 'ge negated' ); ok( not( none( 'g', 'g' ) ge 'g' ), 'ge negated' ); ok( 'f' ge none( 'g', 'h' ), 'ge switched' ); ok( not( 'i' ge none( 'g', 'h' ) ), 'ge negated switched' ); ok( not( 'g' ge none( 'g', 'h' ) ), 'ge negated switched' ); ok( none( 'g', 'h' ) gt 'h', 'gt' ); ok( none( 'g', 'h' ) gt 'i', 'gt' ); ok( not( none( 'g', 'h' ) gt 'f' ), 'gt negated' ); ok( not( none( 'g', 'h' ) gt 'g' ), 'gt negated' ); ok( 'f' gt none( 'g', 'h' ), 'gt switched' ); ok( not( 'h' gt none( 'g', 'h' ) ), 'gt negated switched' ); ok( not( 'i' gt none( 'g', 'h' ) ), 'gt negated switched' ); ok( none( 'g', 'h' ) le 'f', 'le' ); ok( not( none( 'g', 'h' ) le 'h' ), 'le negated' ); ok( not( none( 'g', 'h' ) le 'i' ), 'le negated' ); ok( 'i' le none( 'g', 'h' ), 'le switched' ); ok( not( 'f' le none( 'g', 'h' ) ), 'le negated switched' ); ok( not( 'g' le none( 'g', 'h' ) ), 'le negated switched' ); ok( none( 'g', 'h' ) lt 'f', 'lt' ); ok( not( none( 'g', 'h' ) lt 'i' ), 'lt negated' ); ok( not( none( 'g', 'h' ) lt 'h' ), 'lt negated' ); ok( 'i' lt none( 'g', 'h' ), 'lt switched' ); ok( not( 'f' lt none( 'g', 'h' ) ), 'lt negated switched' ); ok( not( 'g' lt none( 'g', 'h' ) ), 'lt negated switched' ); ok( none( 'a', 'b' ) == qr/\d+/, '== regex' ); ok( qr/^[ab]$/ == none( 3, 4, 5 ), '== regex' ); ok( not( none( 3, 4, 'b' ) == qr/[a-z]/ ), '== regex negated' ); ok( not( qr/\d/ == none( 'a', 'b', 5 ) ), '== regex negated' ); ok( none( 3, 4, 5 ) != qr/[0-9]/, '!= regex' ); ok( qr/[0-9]/ != none( 3, 4, 5 ), '!= regex' ); ok( none( 3, 3, 5 ) != qr/./, '!= regex' ); ok( qr/./ != none( 3, 3, 5 ), '!= regex' ); ok( not( none( 'a', 'b', 5 ) != qr/\d/ ), '!= regex negated' ); ok( not( qr/\d/ != none( 'a', 'b', 5 ) ), '!= regex negated' ); ok( none( undef, '', 0, 0.0 ), 'bool' ); ok( !none( undef, 'a' ), '! bool' ); like( none( 1, 2 ), qr/^Syntax::Keyword::Junction::None=/, 'stringified to ref' ); my @data = qw(3 4 5 6 7); my $junction = none(@data); can_ok $junction, 'values'; my @values = $junction->values; is_deeply \@values, \@data, 'values() in list context'; my $values = $junction->values; is_deeply $values, \@data, 'values() in scalar context'; my $plus1 = $junction->map( sub { $_ + 1 } ); is_deeply( [ $plus1->values ], [ qw( 4 5 6 7 8 ) ], "map method"); libsyntax-keyword-junction-perl-0.003009/t/one.t000066400000000000000000000114261466224114100214510ustar00rootroot00000000000000use strict; use warnings; use Test::More tests => 99; use Syntax::Keyword::Junction 'one'; ok( one( 2, 3 ) == 2, '==' ); ok( one( 2, 3.0 ) == 3, '==' ); ok( one( 1, 2, 3, 4, 5 ) == 2, '==' ); ok( not( one( 2, 3.0 ) == 4 ), '== negated' ); ok( not( one( 3, 3.0 ) == 3 ), '== negated' ); ok( one( 3, 4 ) != 4, '!=' ); ok( not( one( 3, 3.0 ) != 3 ), '!= negated' ); ok( not( one( 3, 4 ) != 5 ), '!= negated' ); ok( one( 3, 4, 5 ) >= 5, '>=' ); ok( one( 3, 4, 6 ) >= 5, '>=' ); ok( one( 1, 2, 3, 4, 6 ) >= 5, '>=' ); ok( not( one( 3, 4, 5 ) >= 6 ), '>= negated' ); ok( not( one( 3, 4, 5 ) >= 4 ), '>= negated' ); ok( not( one( 3, 4, 5 ) >= 2 ), '>= negated' ); ok( 4 >= one(3), '>= switched' ); ok( 4 >= one(4), '>= switched' ); ok( 4 >= one( 3, 5 ), '>= switched' ); ok( not( 2 >= one( 3, 4, 5 ) ), '>= negated switched' ); ok( not( 4 >= one( 3, 4, 5 ) ), '>= negated switched' ); ok( one( 3, 4, 5 ) > 4, '>' ); ok( one( 3, 5 ) > 4, '>' ); ok( not( one( 3, 4, 5 ) > 6 ), '> negated' ); ok( not( one( 3, 4, 5 ) > 3 ), '> negated' ); ok( 4 > one( 3, 4, 5 ), '> switched' ); ok( 4 > one( 3, 5 ), '> switched' ); ok( not( 2 > one( 3, 4, 5 ) ), '> negated switched' ); ok( not( 5 > one( 3, 4, 5 ) ), '> negated switched' ); ok( one( 3, 4, 5 ) <= 3, '<=' ); ok( one( 3, 5 ) <= 4, '<=' ); ok( not( one( 3, 4, 5 ) <= 2 ), '<= negated' ); ok( not( one( 3, 4, 5 ) <= 6 ), '<= negated' ); ok( 5 <= one( 3, 4, 5 ), '<= switched' ); ok( not( 6 <= one( 3, 4, 5 ) ), '<= negated switched' ); ok( not( 3 <= one( 3, 4, 5 ) ), '<= negated switched' ); ok( one( 3, 4, 5 ) < 4, '<' ); ok( one( 5, 4, 3 ) < 4, '<' ); ok( not( one( 3, 4, 5 ) < 2 ), '< negated' ); ok( not( one( 3, 4, 5 ) < 6 ), '< negated' ); ok( 4 < one( 3, 4, 5 ), '< switched' ); ok( 4 < one( 3, 3, 5 ), '< switched' ); ok( not( 6 < one( 3, 4, 5 ) ), '< negated switched' ); ok( not( 3 < one( 3, 4, 5 ) ), '< negated switched' ); ok( one( 'g', 'h' ) eq 'g', 'eq' ); ok( not( one( 'g', 'h' ) eq 'f' ), 'eq negated' ); ok( not( one( 'g', 'g' ) eq 'g' ), 'eq negated' ); ok( one( 'g', 'h' ) ne 'g', 'ne' ); ok( one( 'g', 'h', 'g' ) ne 'g', 'ne' ); ok( not( one( 'i', 'i' ) ne 'i' ), 'ne negated' ); ok( not( one( 'g', 'h' ) ne 'i' ), 'ne negated' ); ok( one( 'g', 'h' ) ge 'h', 'ge' ); ok( one('g') ge 'g', 'ge' ); ok( not( one( 'g', 'h' ) ge 'i' ), 'ge negated' ); ok( not( one( 'g', 'g' ) ge 'g' ), 'ge negated' ); ok( 'h' ge one( 'g', 'i' ), 'ge switched' ); ok( 'g' ge one( 'g', 'h' ), 'ge switched' ); ok( not( 'f' ge one( 'g', 'h' ) ), 'ge negated switched' ); ok( not( 'h' ge one( 'g', 'h' ) ), 'ge negated switched' ); ok( one( 'g', 'h' ) gt 'g', 'gt' ); ok( one( 'g', 'i' ) gt 'h', 'gt' ); ok( not( one( 'g', 'h' ) gt 'f' ), 'gt negated' ); ok( 'h' gt one( 'g', 'h' ), 'gt switched' ); ok( 'h' gt one( 'h', 'g' ), 'gt switched' ); ok( not( 'g' gt one( 'g', 'h' ) ), 'gt negated switched' ); ok( not( 'i' gt one( 'g', 'h' ) ), 'gt negated switched' ); ok( one( 'g', 'i' ) le 'h', 'le' ); ok( not( one( 'g', 'h' ) le 'f' ), 'le negated' ); ok( not( one( 'g', 'g' ) le 'f' ), 'le negated' ); ok( 'g' le one( 'f', 'h' ), 'le switched' ); ok( not( 'i' le one( 'g', 'h' ) ), 'le negated switched' ); ok( not( 'g' le one( 'g', 'h' ) ), 'le negated switched' ); ok( one( 'g', 'h' ) lt 'h', 'lt' ); ok( one( 'h', 'g' ) lt 'h', 'lt' ); ok( not( one( 'g', 'h' ) lt 'i' ), 'lt negated' ); ok( not( one( 'g', 'h' ) lt 'f' ), 'lt negated' ); ok( 'g' lt one( 'g', 'h' ), 'lt switched' ); ok( 'g' lt one( 'h', 'g' ), 'lt switched' ); ok( not( 'f' lt one( 'g', 'h' ) ), 'lt negated switched' ); ok( not( 'i' lt one( 'g', 'h' ) ), 'lt negated switched' ); ok( one( 3, 4, 'a' ) == qr/[a-z]/, '== regex' ); ok( qr/\d/ == one( 'a', 'b', 5 ), '== regex' ); ok( not( one( 2, 3, 'c' ) == qr/\d/ ), '== regex negated' ); ok( not( qr/\d/ == one( 2, 3, 'c' ) ), '== regex negated' ); ok( not( qr/[a-z]+/ == one( 'a', 'b', 3 ) ), '== regex negated' ); ok( one( 3, 4, 'a' ) != qr/[0-9]/, '!= regex' ); ok( qr/[0-9] != one(3,4,'a') /, '!= regex' ); ok( one( 3, 'a', 'c' ) != qr/[a-z]/, '!= regex' ); ok( qr/[a-z] != one(3,'a','c')/, '!= regex' ); ok( not( one( 3, 4, 5 ) != qr/\d/ ), '!= regex negated' ); ok( not( one( 3, 4, 5 ) != qr/[a-z]/ ), '!= regex negated' ); ok( one( 2, 0 ), 'bool' ); ok( one( undef, 'a' ), 'bool' ); ok( one( 'a', '' ), 'bool' ); ok( !one( undef, 0, '' ), '! bool' ); ok( !one( 'a', 'b' ), '! bool' ); like( one( 1, 2 ), qr/^Syntax::Keyword::Junction::One=/, 'stringified to ref' ); my @data = qw(3 4 5 6 7); my $junction = one(@data); can_ok $junction, 'values'; my @values = $junction->values; is_deeply \@values, \@data, 'values() in list context'; my $values = $junction->values; is_deeply $values, \@data, 'values() in scalar context'; my $plus1 = $junction->map( sub { $_ + 1 } ); is_deeply( [ $plus1->values ], [ qw( 4 5 6 7 8 ) ], "map method"); libsyntax-keyword-junction-perl-0.003009/t/smartmatch.t000066400000000000000000000031321466224114100230260ustar00rootroot00000000000000use strict; use warnings; use Test::More; use Syntax::Keyword::Junction; use Syntax::Keyword::Junction::Base; BEGIN { unless (Syntax::Keyword::Junction::Base::_WANT_SMARTMATCH) { plan skip_all => "~~ support requires Perl version >= 5.10.1 and < 5.41.0"; } } no if Syntax::Keyword::Junction::Base::_SMARTMATCH_WARNING_CATEGORY, warnings => Syntax::Keyword::Junction::Base::_SMARTMATCH_WARNING_CATEGORY; plan tests => 16; my $is_1 = sub { $_[0] == 1 }; my $is_2 = sub { $_[0] == 2 }; my $is_5 = sub { $_[0] == 5 }; ok(! (5 ~~ all($is_1,$is_2,$is_5)), '5 !~~ all($is_1,$is_2,$is_5)' ); ok( (5 ~~ any($is_1,$is_2,$is_5)), '5 ~~ any($is_1,$is_2,$is_5)' ); ok(! (5 ~~ none($is_1,$is_2,$is_5)), '5 !~~ none($is_1,$is_2,$is_5)' ); ok( (5 ~~ one($is_1,$is_2,$is_5)), '5 ~~ one($is_1,$is_2,$is_5)' ); ok( (5 ~~ all($is_5,$is_5,$is_5)), '5 ~~ all($is_5,$is_5,$is_5)' ); ok( (5 ~~ any($is_5,$is_5,$is_5)), '5 ~~ any($is_5,$is_5,$is_5)' ); ok(! (5 ~~ none($is_5,$is_5,$is_5)), '5 !~~ none($is_5,$is_5,$is_5)' ); ok(! (5 ~~ one($is_5,$is_5,$is_5)), '5 !~~ one($is_5,$is_5,$is_5)' ); ok(! (3 ~~ all($is_1,$is_2,$is_5)), '3 !~~ all($is_1,$is_2,$is_5)' ); ok(! (3 ~~ any($is_1,$is_2,$is_5)), '3 !~~ any($is_1,$is_2,$is_5)' ); ok( (3 ~~ none($is_1,$is_2,$is_5)), '3 ~~ none($is_1,$is_2,$is_5)' ); ok(! (3 ~~ one($is_1,$is_2,$is_5)), '3 !~~ one($is_1,$is_2,$is_5)' ); ok(! ( all(1,2,5) ~~ $is_5), ' all(1,2,5) !~~ $is_5' ); ok( ( any(1,2,5) ~~ $is_5), ' any(1,2,5) ~~ $is_5' ); ok(! ( none(1,2,5) ~~ $is_5), 'none(1,2,5) !~~ $is_5' ); ok( ( one(1,2,5) ~~ $is_5), ' one(1,2,5) ~~ $is_5' ); libsyntax-keyword-junction-perl-0.003009/t/syntax.t000066400000000000000000000005471466224114100222200ustar00rootroot00000000000000use strict; use warnings; use Test::More; use Test::Needs { 'Sub::Exporter' => 0.986, 'syntax' => 0, }; use syntax junction => { -all => { -prefix => 'syntax_' } }; use Syntax::Keyword::Junction -all => { -prefix => 'orig_' }; ok orig_any(1,2,3) == 2, 'regular export works'; ok syntax_any(1,2,3) == 2, 'syntax export works'; done_testing; libsyntax-keyword-junction-perl-0.003009/weaver.ini000066400000000000000000000001631466224114100222260ustar00rootroot00000000000000[@CorePrep] [-SingleEncoding] [-StopWords] [Generic / NAME] [Leftovers] [Bugs] [Contributors] [Authors] [Legal] libsyntax-keyword-junction-perl-0.003009/xt/000077500000000000000000000000001466224114100206675ustar00rootroot00000000000000libsyntax-keyword-junction-perl-0.003009/xt/author/000077500000000000000000000000001466224114100221715ustar00rootroot00000000000000libsyntax-keyword-junction-perl-0.003009/xt/author/distmeta.t000066400000000000000000000002231466224114100241650ustar00rootroot00000000000000#!perl # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. use strict; use warnings; use Test::CPAN::Meta; meta_yaml_ok(); libsyntax-keyword-junction-perl-0.003009/xt/author/eol.t000066400000000000000000000014051466224114100231350ustar00rootroot00000000000000use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::EOL 0.19 use Test::More 0.88; use Test::EOL; my @files = ( 'lib/Syntax/Feature/Junction.pm', 'lib/Syntax/Keyword/Junction.pm', 'lib/Syntax/Keyword/Junction/All.pm', 'lib/Syntax/Keyword/Junction/Any.pm', 'lib/Syntax/Keyword/Junction/Base.pm', 'lib/Syntax/Keyword/Junction/None.pm', 'lib/Syntax/Keyword/Junction/One.pm', 't/00-compile.t', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/01_use.t', 't/all.t', 't/any.t', 't/import_tags.t', 't/join.t', 't/no_import.t', 't/none.t', 't/one.t', 't/smartmatch.t', 't/syntax.t' ); eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; done_testing; libsyntax-keyword-junction-perl-0.003009/xt/author/mojibake.t000066400000000000000000000001511466224114100241340ustar00rootroot00000000000000#!perl use strict; use warnings qw(all); use Test::More; use Test::Mojibake; all_files_encoding_ok(); libsyntax-keyword-junction-perl-0.003009/xt/author/no-tabs.t000066400000000000000000000013531466224114100237230ustar00rootroot00000000000000use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.15 use Test::More 0.88; use Test::NoTabs; my @files = ( 'lib/Syntax/Feature/Junction.pm', 'lib/Syntax/Keyword/Junction.pm', 'lib/Syntax/Keyword/Junction/All.pm', 'lib/Syntax/Keyword/Junction/Any.pm', 'lib/Syntax/Keyword/Junction/Base.pm', 'lib/Syntax/Keyword/Junction/None.pm', 'lib/Syntax/Keyword/Junction/One.pm', 't/00-compile.t', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/01_use.t', 't/all.t', 't/any.t', 't/import_tags.t', 't/join.t', 't/no_import.t', 't/none.t', 't/one.t', 't/smartmatch.t', 't/syntax.t' ); notabs_ok($_) foreach @files; done_testing; libsyntax-keyword-junction-perl-0.003009/xt/author/pod-spell.t000066400000000000000000000007701466224114100242610ustar00rootroot00000000000000use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007005 use Test::Spelling 0.12; use Pod::Wordlist; add_stopwords(); all_pod_files_spelling_ok( qw( bin lib ) ); __DATA__ All Any Arthur Axel Base Carl Cochrane David Feature Franks Graham Hoelz Junction Keyword Knop Maxime Mengué Michael None Olivier One Paul Ricardo Rob Schmidt Schout Signes Soulé Steinbrunner Syntax btik cpan dolmen dsteinbrunner fREW frioux haarg lib paul rjbs rob schoutm libsyntax-keyword-junction-perl-0.003009/xt/author/pod-syntax.t000066400000000000000000000002521466224114100244630ustar00rootroot00000000000000#!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); libsyntax-keyword-junction-perl-0.003009/xt/author/portability.t000066400000000000000000000001301466224114100247120ustar00rootroot00000000000000use strict; use warnings; use Test::More; use Test::Portability::Files; run_tests(); libsyntax-keyword-junction-perl-0.003009/xt/author/test-version.t000066400000000000000000000006371466224114100250260ustar00rootroot00000000000000use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::Version 1.09 use Test::Version; my @imports = qw( version_all_ok ); my $params = { is_strict => 0, has_version => 1, multiple => 0, }; push @imports, $params if version->parse( $Test::Version::VERSION ) >= version->parse('1.002'); Test::Version->import(@imports); version_all_ok; done_testing; libsyntax-keyword-junction-perl-0.003009/xt/release/000077500000000000000000000000001466224114100223075ustar00rootroot00000000000000libsyntax-keyword-junction-perl-0.003009/xt/release/changes_has_content.t000066400000000000000000000021041466224114100264660ustar00rootroot00000000000000use Test::More tests => 2; note 'Checking Changes'; my $changes_file = 'Changes'; my $newver = '0.003009'; my $trial_token = '-TRIAL'; my $encoding = 'UTF-8'; SKIP: { ok(-e $changes_file, "$changes_file file exists") or skip 'Changes is missing', 1; ok(_get_changes($newver), "$changes_file has content for $newver"); } done_testing; sub _get_changes { my $newver = shift; # parse changelog to find commit message open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!"; my $changelog = join('', <$fh>); if ($encoding) { require Encode; $changelog = Encode::decode($encoding, $changelog, Encode::FB_CROAK()); } close $fh; my @content = grep { /^$newver(?:$trial_token)?(?:\s+|$)/ ... /^\S/ } # from newver to un-indented split /\n/, $changelog; shift @content; # drop the version line # drop unindented last line and trailing blank lines pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ ); # return number of non-blank lines return scalar @content; } libsyntax-keyword-junction-perl-0.003009/xt/release/cpan-changes.t000066400000000000000000000003441466224114100250240ustar00rootroot00000000000000use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::CPAN::Changes 0.012 use Test::More 0.96 tests => 1; use Test::CPAN::Changes; subtest 'changes_ok' => sub { changes_file_ok('Changes'); };