Test-Synopsis-0.14000755001750001750 012660753207 14207 5ustar00zoffixzoffix000000000000README100644001750001750 55612660753207 15136 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14 This archive contains the distribution Test-Synopsis, version 0.14: Test your SYNOPSIS code This software is copyright (c) 2016 by Tatsuhiko Miyagawa. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. This README file was generated by Dist::Zilla::Plugin::Readme v5.043. Changes100644001750001750 661012660753207 15566 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14Revision history for Perl extension Test::Synopsis 0.14 2016-02-16 - Complete rewrite by dolmen [BREAKING CHANGES] - The undocumented PRIVATE subroutine extract_synopsis has been renamed. Any code using it will break 0.13 2016-01-04 - Fix #12 conflict with multiple chunks (by turnstep) 0.12 2015-12-27 - Add META.json (monsieurp) 0.11 2014-10-04 [Changes by ZOFFIX] - Added #10 to CAVEATS (redefined warnings) - Fixed #11 (failing tests on newer perls) 0.10 2014-02-07 [Changes by ZOFFIX] - Reverted the change of renaming extract_synopsis() to _extract_synopsis(), as it appears some distros have used undocumented extract_synopsis() in their user tests, and the change is causing their distros to fail - Added contributors into META file through dzil plugin 0.09 2014-02-06 [Changes by ZOFFIX] - Fixed prereqs to allow earlier versions of Test-Simple (Issue #9) - Removed POD errors from test .pm's to increase Kwalitee 0.08 2014-02-05 [Changes by ZOFFIX] - Implemented proper handling of __DATA__ tokens - Removed unwanted warnings issued during tests - Upped required Test-Simple distro version (Fixes Issue #9) - Minor pod fixes 0.07 2014-02-04 [Changes by ZOFFIX] - Converted to dzil for automation of everything and auto-generation of all the author/release tests and extra files - Fixed RT#84863 (should ignore descriptions, and other text that is not code) https://rt.cpan.org/Ticket/Display.html?id=84863 - Fixed RT#76856 (Sandbox breaks when combining synopses that use Moose and Moose::Role) https://rt.cpan.org/Ticket/Display.html?id=76856 - Fixed RT#69438 (heredocs fail to terminate because of the leading space for verbatim blocks) https://rt.cpan.org/Ticket/Display.html?id=69438 - Fixed RT#54731 (suggest =for conditionalized synopsis check) https://rt.cpan.org/Ticket/Display.html?id=54731 - Fixed RT#53192 (missing Copyright information for Test::Synopsis) https://rt.cpan.org/Ticket/Display.html?id=53192 - Fixed RT#52684 (pod directive to skip Test::Synopsis) https://rt.cpan.org/Ticket/Display.html?id=52684 - Fixed RT#51534 (end =for at blank line) https://rt.cpan.org/Ticket/Display.html?id=51534 - Fixed RT#51535 (show failing code on error) https://rt.cpan.org/Ticket/Display.html?id=51535 0.06 2009-06-06 11:07:50 PDT 2009 - Reworked NoPod tests so it doesn't sit in lib/ and won't be installed. 0.05 2009-06-06 10:55:02 PDT 2009 - use Test::Builder::Module to support forward compatibilities with Test::More - Don't warn in tr/// if there is no pod at all. (Thanks to hanekomu) 0.04 2009-03-05 17:19:13 PST 2009 - Fixed a doc bug where all_synopsis_ok() is taking a directory which it doesn't. 0.03 2009-02-25 20:48:54 PST 2009 - Added file name and line number to eval context (Thanks to Daisuke Maki and Goro Fuji) 0.02 2009-02-24 12:22:03 PST - Added more docs. - eval the code in a more separate sandbox so that variables in Test::Synopsis won't affect. 0.01 2009-02-24 00:21:02 PST - original version LICENSE100644001750001750 4367712660753207 15336 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14This software is copyright (c) 2016 by Tatsuhiko Miyagawa. 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) 2016 by Tatsuhiko Miyagawa. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2016 by Tatsuhiko Miyagawa. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End INSTALL100644001750001750 170012660753207 15317 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14This is the Perl distribution Test-Synopsis. Installing Test-Synopsis is straightforward. ## Installation with cpanm If you have cpanm, you only need one line: % cpanm Test::Synopsis If you are installing into a system-wide directory, you may need to pass the "-S" flag to cpanm, which uses sudo to install the module: % cpanm -S Test::Synopsis ## Installing with the CPAN shell Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan Test::Synopsis ## Manual installation As a last resort, you can manually install it. Download the tarball, untar it, then build it: % perl Makefile.PL % make && make test Then install it: % make install If you are installing into a system-wide directory, you may need to run: % sudo make install ## Documentation Test-Synopsis documentation is available as POD. You can run perldoc from a shell to read the documentation: % perldoc Test::Synopsis dist.ini100644001750001750 224612660753207 15740 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14name = Test-Synopsis author = Tatsuhiko Miyagawa license = Perl_5 copyright_holder = Tatsuhiko Miyagawa [@Author::ZOFFIX] -remove = AutoMetaResources -remove = Test::Pod::LinkCheck ; Failing for a strange reason (firewalled?) -remove = Test::UnusedVars ; reporting false positives -remove = Git::NextVersion -remove = Git::Tag -remove = Git::Check -remove = Git::Commit -remove = Git::Push [Prereqs / TestRequires] Test::Builder = 0.34 [Prereqs / DevelopRequires] Pod::Wordlist = 1.06 Test::More = 0.96 [AutoMetaResources] bugtracker.github = user:miyagawa repository.github = user:miyagawa homepage = http://metacpan.org/release/%{dist} [Meta::Contributors] contributor = Kevin Ryde contributor = Marcel Grünauer contributor = Mike Doherty contributor = Patrice Clement contributor = Greg Sabino Mullane contributor = Zoffix Znet contributor = Olivier Mengué [Git::NextVersion] first_version = 0.07 version_regexp = ^(.+)$ [Git::Tag] tag_format = %v tag_message = %v [Git::Check] [Git::Commit] [Git::Push] [MetaJSON] META.yml100644001750001750 3162012660753207 15563 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14--- abstract: 'Test your SYNOPSIS code' author: - 'Tatsuhiko Miyagawa ' build_requires: File::Spec: '0' IO::Handle: '0' IPC::Open3: '0' Test::Builder: '0.34' Test::Builder::Tester: '0' Test::More: '0' blib: '1.01' perl: 5.008_001 configure_requires: ExtUtils::MakeMaker: '0' perl: 5.008_001 dynamic_config: 0 generated_by: 'Dist::Zilla version 5.043, CPAN::Meta::Converter version 2.150001' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Test-Synopsis provides: Test::Synopsis: file: lib/Test/Synopsis.pm version: '0.14' requires: ExtUtils::Manifest: '0' Pod::Simple: '0' Test::Builder::Module: '0' parent: '0' perl: 5.008_001 strict: '0' warnings: '0' resources: bugtracker: https://github.com/miyagawa/test-synopsis/issues homepage: http://metacpan.org/release/Test-Synopsis repository: git://github.com/miyagawa/test-synopsis.git version: '0.14' x_Dist_Zilla: perl: version: '5.022001' plugins: - class: Dist::Zilla::Plugin::OurPkgVersion name: '@Author::ZOFFIX/OurPkgVersion' version: '0.06' - class: Dist::Zilla::Plugin::Pod::Spiffy name: '@Author::ZOFFIX/Pod::Spiffy' version: '1.001007' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 1 check_all_prereqs: 1 modules: [] phase: release skip: - ExtUtils::MakeMaker - File::Copy - IPC::Open3 - base - strict - warnings name: '@Author::ZOFFIX/PromptIfStale' version: '0.047' - class: Dist::Zilla::Plugin::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: [] exclude_match: [] follow_symlinks: 0 include_dotfiles: 0 prefix: '' prune_directory: [] root: . name: '@Author::ZOFFIX/GatherDir' version: '5.043' - class: Dist::Zilla::Plugin::PruneCruft name: '@Author::ZOFFIX/PruneCruft' version: '5.043' - class: Dist::Zilla::Plugin::ManifestSkip name: '@Author::ZOFFIX/ManifestSkip' version: '5.043' - class: Dist::Zilla::Plugin::MetaYAML name: '@Author::ZOFFIX/MetaYAML' version: '5.043' - class: Dist::Zilla::Plugin::License name: '@Author::ZOFFIX/License' version: '5.043' - class: Dist::Zilla::Plugin::Readme name: '@Author::ZOFFIX/Readme' version: '5.043' - class: Dist::Zilla::Plugin::ExecDir name: '@Author::ZOFFIX/ExecDir' version: '5.043' - class: Dist::Zilla::Plugin::ShareDir name: '@Author::ZOFFIX/ShareDir' version: '5.043' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: '@Author::ZOFFIX/MakeMaker' version: '5.043' - class: Dist::Zilla::Plugin::Manifest name: '@Author::ZOFFIX/Manifest' version: '5.043' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@Author::ZOFFIX/AutoPrereqs' version: '5.043' - class: Dist::Zilla::Plugin::MetaConfig name: '@Author::ZOFFIX/MetaConfig' version: '5.043' - class: Dist::Zilla::Plugin::Prereqs::AuthorDeps name: '@Author::ZOFFIX/Prereqs::AuthorDeps' version: '0.005' - class: Dist::Zilla::Plugin::MinimumPerl name: '@Author::ZOFFIX/MinimumPerl' version: '1.006' - class: Dist::Zilla::Plugin::MetaProvides::Package config: Dist::Zilla::Plugin::MetaProvides::Package: finder_objects: - class: Dist::Zilla::Plugin::FinderCode name: '@Author::ZOFFIX/MetaProvides::Package/AUTOVIV/:InstallModulesPM' version: '5.043' Dist::Zilla::Role::MetaProvider::Provider: Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.001011' inherit_missing: '1' inherit_version: '1' meta_noindex: '1' name: '@Author::ZOFFIX/MetaProvides::Package' version: '2.003001' - class: Dist::Zilla::Plugin::InstallGuide name: '@Author::ZOFFIX/InstallGuide' version: '1.200006' - class: Dist::Zilla::Plugin::ReadmeAnyFromPod config: Dist::Zilla::Role::FileWatcher: version: '0.006' name: '@Author::ZOFFIX/ReadmeAnyFromPod' version: '0.150250' - class: Dist::Zilla::Plugin::Test::Compile config: Dist::Zilla::Plugin::Test::Compile: bail_out_on_fail: '0' fail_on_warning: author fake_home: 0 filename: t/00-compile.t module_finder: - ':InstallModules' needs_display: 0 phase: test script_finder: - ':PerlExecFiles' skips: [] name: '@Author::ZOFFIX/Test::Compile' version: '2.054' - class: Dist::Zilla::Plugin::Test::DistManifest name: '@Author::ZOFFIX/Test::DistManifest' version: '2.000005' - class: Dist::Zilla::Plugin::Test::EOL config: Dist::Zilla::Plugin::Test::EOL: filename: xt/author/eol.t finder: - ':InstallModules' - ':ExecFiles' - ':TestFiles' trailing_whitespace: '1' name: '@Author::ZOFFIX/Test::EOL' version: '0.18' - class: Dist::Zilla::Plugin::Test::Version name: '@Author::ZOFFIX/Test::Version' version: '1.05' - class: Dist::Zilla::Plugin::Test::Kwalitee config: Dist::Zilla::Plugin::Test::Kwalitee: filename: xt/release/kwalitee.t skiptest: [] name: '@Author::ZOFFIX/Test::Kwalitee' version: '2.12' - class: Dist::Zilla::Plugin::MetaTests name: '@Author::ZOFFIX/MetaTests' version: '5.043' - class: Dist::Zilla::Plugin::Test::CPAN::Meta::JSON name: '@Author::ZOFFIX/Test::CPAN::Meta::JSON' version: '0.004' - class: Dist::Zilla::Plugin::MojibakeTests name: '@Author::ZOFFIX/MojibakeTests' version: '0.8' - class: Dist::Zilla::Plugin::Test::NoTabs config: Dist::Zilla::Plugin::Test::NoTabs: filename: xt/author/no-tabs.t finder: - ':InstallModules' - ':ExecFiles' - ':TestFiles' name: '@Author::ZOFFIX/Test::NoTabs' version: '0.15' - class: Dist::Zilla::Plugin::PodCoverageTests name: '@Author::ZOFFIX/PodCoverageTests' version: '5.043' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@Author::ZOFFIX/PodSyntaxTests' version: '5.043' - class: Dist::Zilla::Plugin::Test::Portability name: '@Author::ZOFFIX/Test::Portability' version: '2.000006' - class: Dist::Zilla::Plugin::Test::Synopsis name: '@Author::ZOFFIX/Test::Synopsis' version: '2.000006' - class: Dist::Zilla::Plugin::Test::CPAN::Changes name: '@Author::ZOFFIX/Test::CPAN::Changes' version: '0.009' - class: Dist::Zilla::Plugin::Test::PodSpelling config: Dist::Zilla::Plugin::Test::PodSpelling: directories: [] spell_cmd: '' stopwords: [] wordlist: Pod::Wordlist name: '@Author::ZOFFIX/Test::PodSpelling' version: '2.007000' - class: Dist::Zilla::Plugin::CheckSelfDependency config: Dist::Zilla::Plugin::CheckSelfDependency: finder: - ':InstallModules' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000026' version: '0.003' name: '@Author::ZOFFIX/CheckSelfDependency' version: '0.011' - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@Author::ZOFFIX/CheckPrereqsIndexed' version: '0.017' - class: Dist::Zilla::Plugin::Test::MinimumVersion name: '@Author::ZOFFIX/Test::MinimumVersion' version: '2.000006' - class: Dist::Zilla::Plugin::CopyFilesFromRelease config: Dist::Zilla::Plugin::CopyFilesFromRelease: filename: - README.md match: [] name: '@Author::ZOFFIX/CopyFilesFromRelease' version: '0.006' - class: Dist::Zilla::Plugin::TestRelease name: '@Author::ZOFFIX/TestRelease' version: '5.043' - class: Dist::Zilla::Plugin::InstallRelease name: '@Author::ZOFFIX/InstallRelease' version: '0.008' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Author::ZOFFIX/ConfirmRelease' version: '5.043' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@Author::ZOFFIX/UploadToCPAN' version: '5.043' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: TestRequires version: '5.043' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: requires name: DevelopRequires version: '5.043' - class: Dist::Zilla::Plugin::AutoMetaResources name: AutoMetaResources version: '1.21' - class: Dist::Zilla::Plugin::Meta::Contributors name: Meta::Contributors version: '0.002' - class: Dist::Zilla::Plugin::Git::NextVersion config: Dist::Zilla::Plugin::Git::NextVersion: first_version: '0.07' version_by_branch: 0 version_regexp: (?^u:^(.+)$) Dist::Zilla::Role::Git::Repo: repo_root: . name: Git::NextVersion version: '2.036' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: '0.14' tag_format: '%v' tag_message: '%v' Dist::Zilla::Role::Git::Repo: repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: Git::Tag version: '2.036' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - dist.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: repo_root: . name: Git::Check version: '2.036' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: v%v%n%n%c Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - dist.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: Git::Commit version: '2.036' - class: Dist::Zilla::Plugin::Git::Push config: Dist::Zilla::Plugin::Git::Push: push_to: - origin remotes_must_exist: 1 Dist::Zilla::Role::Git::Repo: repo_root: . name: Git::Push version: '2.036' - class: Dist::Zilla::Plugin::MetaJSON name: MetaJSON version: '5.043' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '5.043' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '5.043' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '5.043' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '5.043' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '5.043' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '5.043' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '5.043' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '5.043' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '5.043' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '5.043' - class: Dist::Zilla::Plugin::FinderCode name: '@Author::ZOFFIX/MetaProvides::Package/AUTOVIV/:InstallModulesPM' version: '5.043' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '5.043' x_contributors: - 'Kevin Ryde ' - 'Marcel Grünauer ' - 'Mike Doherty ' - 'Patrice Clement ' - 'Greg Sabino Mullane ' - 'Zoffix Znet ' - 'Olivier Mengué ' MANIFEST100644001750001750 216412660753207 15424 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.043. Changes INSTALL LICENSE MANIFEST META.json META.yml Makefile.PL README README.md dist.ini lib/Test/Synopsis.pm t/00-compile.t t/01-fail-if-SYNOPSIS-has-errors.t t/02-END-token-errors.t t/03-end-in-pod.t t/04-HEREDOC.t t/05-multi-chunks-clash.t t/05-multi-files-clash.t t/06-for.t t/07-nopod.t t/08-plain-text-in-pod.t t/09-synopsis.t t/10-in-pod-skip.t t/11-DATA-in-pod.t t/12-DATA-token-errors.t t/lib/BrokenSYNOPSIS01.pm t/lib/ENDInPod.pm t/lib/ENDInPodWithError.pm t/lib/NoPod.pm t/lib/PlainTextInPod.pm t/lib/Test03.pm t/lib/Test03Other.pm t/lib/Test04HEREDOC.pm t/lib/Test10HEREDOC.pm t/lib/Test10InPodSkipWithBegin.pm t/lib/Test11DATAInPod.pm t/lib/Test12DATAInPodWithError.pm t/lib/TestMultipleChunks.pm xt/author/eol.t xt/author/mojibake.t xt/author/no-tabs.t xt/author/pod-coverage.t xt/author/pod-spell.t xt/author/pod-syntax.t xt/author/test-version.t xt/release/cpan-changes.t xt/release/dist-manifest.t xt/release/distmeta.t xt/release/kwalitee.t xt/release/meta-json.t xt/release/minimum-version.t xt/release/portability.t xt/release/synopsis.t README.md100644001750001750 1370712660753207 15577 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14# NAME Test::Synopsis - Test your SYNOPSIS code # SYNOPSIS # xt/synopsis.t (with Module::Install::AuthorTests) use Test::Synopsis; all_synopsis_ok(); # Or, run safe without Test::Synopsis use Test::More; eval "use Test::Synopsis"; plan skip_all => "Test::Synopsis required for testing" if $@; all_synopsis_ok(); # DESCRIPTION Test::Synopsis is an (author) test module to find .pm or .pod files under your _lib_ directory and then make sure the example snippet code in your _SYNOPSIS_ section passes the perl compile check. Note that this module only checks the perl syntax (by wrapping the code with `sub`) and doesn't actually run the code, **UNLESS** that code is a `BEGIN {}` block or a `use` statement. Suppose you have the following POD in your module. =head1 NAME Awesome::Template - My awesome template =head1 SYNOPSIS use Awesome::Template; my $template = Awesome::Template->new; $tempalte->render("template.at"); =head1 DESCRIPTION An user of your module would try copy-paste this synopsis code and find that this code doesn't compile because there's a typo in your variable name _$tempalte_. Test::Synopsis will catch that error before you ship it. # VARIABLE DECLARATIONS Sometimes you might want to put some undeclared variables in your synopsis, like: =head1 SYNOPSIS use Data::Dumper::Names; print Dumper($scalar, \@array, \%hash); This assumes these variables like _$scalar_ are defined elsewhere in module user's code, but Test::Synopsis, by default, will complain that these variables are not declared: Global symbol "$scalar" requires explicit package name at ... In this case, you can add the following POD sequence elsewhere in your POD: =for test_synopsis no strict 'vars' Or more explicitly, =for test_synopsis my($scalar, @array, %hash); Test::Synopsis will find these `=for` blocks and these statements are prepended before your SYNOPSIS code when being evaluated, so those variable name errors will go away, without adding unnecessary bits in SYNOPSIS which might confuse users. # SKIPPING TEST FROM INSIDE THE POD You can use a `BEGIN{}` block in the `=for test_synopsis` to check for specific conditions (e.g. if a module is present), and possibly skip the test. If you `die()` inside the `BEGIN{}` block and the die message begins with sequence `SKIP:` (note the colon at the end), the test will be skipped for that document. =head1 SYNOPSIS =for test_synopsis BEGIN { die "SKIP: skip this pod, it's horrible!\n"; } $x; # undeclared variable, but we skipped the test! =end # EXPORTED SUBROUTINES ## `all_synopsis_ok` all_synopsis_ok(); all_synopsis_ok( dump_all_code_on_error => 1 ); Checks the SYNOPSIS code in all your modules. Takes **optional** arguments as key/value pairs. Possible arguments are as follows: ### `dump_all_code_on_error` all_synopsis_ok( dump_all_code_on_error => 1 ); Takes true or false values as a value. **Defaults to:** false. When set to a true value, if an error is discovered in the SYNOPSIS code, the test will dump the entire snippet of code it tried to test. Use this if you want to copy/paste and play around with the code until the error is fixed. The dumped code will include any of the `=for` code you specified (see ["VARIABLE DECLARATIONS"](#variable-declarations) section above) as well as a few internal bits this test module uses to make SYNOPSIS code checking possible. **Note:** you will likely have to remove the `#` and a space at the start of each line (`perl -pi -e 's/^#\s//;' TEMP_FILE_WITH_CODE`) ## `synopsis_ok` use Test::More tests => 1; use Test::Synopsis; synopsis_ok("t/lib/NoPod.pm"); synopsis_ok(qw/Pod1.pm Pod2.pm Pod3.pm/); Lets you test a single file. **Note:** you must setup your own plan if you use this subroutine (e.g. with `use Test::More tests => 1;`). **Takes** a list of filenames for documents containing SYNOPSIS code to test. # CAVEATS This module will not check code past the `__END__` or `__DATA__` tokens, if one is present in the SYNOPSIS code. This module will actually execute `use` statements and any code you specify in the `BEGIN {}` blocks in the SYNOPSIS. If you're using HEREDOCs in your SYNOPSIS, you will need to place the ending of the HEREDOC at the same indent as the first line of the code of your SYNOPSIS. Redefinition warnings can be turned off with =for test_synopsis no warnings 'redefine'; # REPOSITORY Fork this module on GitHub: [https://github.com/miyagawa/Test-Synopsis](https://github.com/miyagawa/Test-Synopsis) # BUGS To report bugs or request features, please use [https://github.com/miyagawa/Test-Synopsis/issues](https://github.com/miyagawa/Test-Synopsis/issues) If you can't access GitHub, you can email your request to `bug-Test-Synopsis at rt.cpan.org` # AUTHOR Tatsuhiko Miyagawa <miyagawa@bulknews.net> Goro Fuji blogged about the original idea at [http://d.hatena.ne.jp/gfx/20090224/1235449381](http://d.hatena.ne.jp/gfx/20090224/1235449381) based on the testing code taken from [Test::Weaken](https://metacpan.org/pod/Test::Weaken). # MAINTAINER Zoffix Znet <cpan (at) zoffix.com> # CONTRIBUTORS - Kevin Ryde ([KRYDE](https://metacpan.org/author/KRYDE)) - Marcel Grünauer ([MARCEL](https://metacpan.org/author/MARCEL)) - Mike Doherty ([DOHERTY](https://metacpan.org/author/DOHERTY)) - Patrice Clement ([monsieurp](https://github.com/monsieurp)) - Greg Sabino Mullane ([TURNSTEP](https://metacpan.org/author/TURNSTEP)) - Zoffix Znet ([ZOFFIX](https://metacpan.org/author/ZOFFIX)) - Olivier Mengué ([DOLMEN](https://metacpan.org/author/DOLMEN)) # LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. # COPYRIGHT This library is Copyright (c) Tatsuhiko Miyagawa # SEE ALSO [Test::Pod](https://metacpan.org/pod/Test::Pod), [Test::UseAllModules](https://metacpan.org/pod/Test::UseAllModules), [Test::Inline](https://metacpan.org/pod/Test::Inline) META.json100644001750001750 5145312660753207 15741 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14{ "abstract" : "Test your SYNOPSIS code", "author" : [ "Tatsuhiko Miyagawa " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 5.043, CPAN::Meta::Converter version 2.150001", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Test-Synopsis", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0", "perl" : "5.008_001" } }, "develop" : { "requires" : { "Dist::Zilla" : "5", "Dist::Zilla::Plugin::AutoMetaResources" : "0", "Dist::Zilla::Plugin::Git::Check" : "0", "Dist::Zilla::Plugin::Git::Commit" : "0", "Dist::Zilla::Plugin::Git::NextVersion" : "0", "Dist::Zilla::Plugin::Git::Push" : "0", "Dist::Zilla::Plugin::Git::Tag" : "0", "Dist::Zilla::Plugin::Meta::Contributors" : "0", "Dist::Zilla::Plugin::MetaJSON" : "0", "Dist::Zilla::Plugin::Prereqs" : "0", "Dist::Zilla::PluginBundle::Author::ZOFFIX" : "0", "Pod::Coverage::TrustPod" : "0", "Pod::Wordlist" : "1.06", "Software::License::Perl_5" : "0", "Test::CPAN::Changes" : "0.19", "Test::CPAN::Meta" : "0", "Test::CPAN::Meta::JSON" : "0.16", "Test::EOL" : "0", "Test::Kwalitee" : "1.21", "Test::Mojibake" : "0", "Test::More" : "0.96", "Test::NoTabs" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "Test::Spelling" : "0.12", "Test::Synopsis" : "0", "Test::Version" : "1" } }, "runtime" : { "requires" : { "ExtUtils::Manifest" : "0", "Pod::Simple" : "0", "Test::Builder::Module" : "0", "parent" : "0", "perl" : "5.008_001", "strict" : "0", "warnings" : "0" } }, "test" : { "requires" : { "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Test::Builder" : "0.34", "Test::Builder::Tester" : "0", "Test::More" : "0", "blib" : "1.01", "perl" : "5.008_001" } } }, "provides" : { "Test::Synopsis" : { "file" : "lib/Test/Synopsis.pm", "version" : "0.14" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/miyagawa/test-synopsis/issues" }, "homepage" : "http://metacpan.org/release/Test-Synopsis", "repository" : { "type" : "git", "url" : "git://github.com/miyagawa/test-synopsis.git", "web" : "https://github.com/miyagawa/test-synopsis" } }, "version" : "0.14", "x_Dist_Zilla" : { "perl" : { "version" : "5.022001" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::OurPkgVersion", "name" : "@Author::ZOFFIX/OurPkgVersion", "version" : "0.06" }, { "class" : "Dist::Zilla::Plugin::Pod::Spiffy", "name" : "@Author::ZOFFIX/Pod::Spiffy", "version" : "1.001007" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 1, "check_all_prereqs" : 1, "modules" : [], "phase" : "release", "skip" : [ "ExtUtils::MakeMaker", "File::Copy", "IPC::Open3", "base", "strict", "warnings" ] } }, "name" : "@Author::ZOFFIX/PromptIfStale", "version" : "0.047" }, { "class" : "Dist::Zilla::Plugin::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [], "exclude_match" : [], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." } }, "name" : "@Author::ZOFFIX/GatherDir", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@Author::ZOFFIX/PruneCruft", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@Author::ZOFFIX/ManifestSkip", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@Author::ZOFFIX/MetaYAML", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@Author::ZOFFIX/License", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@Author::ZOFFIX/Readme", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@Author::ZOFFIX/ExecDir", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@Author::ZOFFIX/ShareDir", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "@Author::ZOFFIX/MakeMaker", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@Author::ZOFFIX/Manifest", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@Author::ZOFFIX/AutoPrereqs", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@Author::ZOFFIX/MetaConfig", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::Prereqs::AuthorDeps", "name" : "@Author::ZOFFIX/Prereqs::AuthorDeps", "version" : "0.005" }, { "class" : "Dist::Zilla::Plugin::MinimumPerl", "name" : "@Author::ZOFFIX/MinimumPerl", "version" : "1.006" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Package", "config" : { "Dist::Zilla::Plugin::MetaProvides::Package" : { "finder_objects" : [ { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "@Author::ZOFFIX/MetaProvides::Package/AUTOVIV/:InstallModulesPM", "version" : "5.043" } ] }, "Dist::Zilla::Role::MetaProvider::Provider" : { "Dist::Zilla::Role::MetaProvider::Provider::VERSION" : "2.001011", "inherit_missing" : "1", "inherit_version" : "1", "meta_noindex" : "1" } }, "name" : "@Author::ZOFFIX/MetaProvides::Package", "version" : "2.003001" }, { "class" : "Dist::Zilla::Plugin::InstallGuide", "name" : "@Author::ZOFFIX/InstallGuide", "version" : "1.200006" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", "config" : { "Dist::Zilla::Role::FileWatcher" : { "version" : "0.006" } }, "name" : "@Author::ZOFFIX/ReadmeAnyFromPod", "version" : "0.150250" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "config" : { "Dist::Zilla::Plugin::Test::Compile" : { "bail_out_on_fail" : "0", "fail_on_warning" : "author", "fake_home" : 0, "filename" : "t/00-compile.t", "module_finder" : [ ":InstallModules" ], "needs_display" : 0, "phase" : "test", "script_finder" : [ ":PerlExecFiles" ], "skips" : [] } }, "name" : "@Author::ZOFFIX/Test::Compile", "version" : "2.054" }, { "class" : "Dist::Zilla::Plugin::Test::DistManifest", "name" : "@Author::ZOFFIX/Test::DistManifest", "version" : "2.000005" }, { "class" : "Dist::Zilla::Plugin::Test::EOL", "config" : { "Dist::Zilla::Plugin::Test::EOL" : { "filename" : "xt/author/eol.t", "finder" : [ ":InstallModules", ":ExecFiles", ":TestFiles" ], "trailing_whitespace" : "1" } }, "name" : "@Author::ZOFFIX/Test::EOL", "version" : "0.18" }, { "class" : "Dist::Zilla::Plugin::Test::Version", "name" : "@Author::ZOFFIX/Test::Version", "version" : "1.05" }, { "class" : "Dist::Zilla::Plugin::Test::Kwalitee", "config" : { "Dist::Zilla::Plugin::Test::Kwalitee" : { "filename" : "xt/release/kwalitee.t", "skiptest" : [] } }, "name" : "@Author::ZOFFIX/Test::Kwalitee", "version" : "2.12" }, { "class" : "Dist::Zilla::Plugin::MetaTests", "name" : "@Author::ZOFFIX/MetaTests", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::Test::CPAN::Meta::JSON", "name" : "@Author::ZOFFIX/Test::CPAN::Meta::JSON", "version" : "0.004" }, { "class" : "Dist::Zilla::Plugin::MojibakeTests", "name" : "@Author::ZOFFIX/MojibakeTests", "version" : "0.8" }, { "class" : "Dist::Zilla::Plugin::Test::NoTabs", "config" : { "Dist::Zilla::Plugin::Test::NoTabs" : { "filename" : "xt/author/no-tabs.t", "finder" : [ ":InstallModules", ":ExecFiles", ":TestFiles" ] } }, "name" : "@Author::ZOFFIX/Test::NoTabs", "version" : "0.15" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "@Author::ZOFFIX/PodCoverageTests", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@Author::ZOFFIX/PodSyntaxTests", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::Test::Portability", "name" : "@Author::ZOFFIX/Test::Portability", "version" : "2.000006" }, { "class" : "Dist::Zilla::Plugin::Test::Synopsis", "name" : "@Author::ZOFFIX/Test::Synopsis", "version" : "2.000006" }, { "class" : "Dist::Zilla::Plugin::Test::CPAN::Changes", "name" : "@Author::ZOFFIX/Test::CPAN::Changes", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::Test::PodSpelling", "config" : { "Dist::Zilla::Plugin::Test::PodSpelling" : { "directories" : [], "spell_cmd" : "", "stopwords" : [], "wordlist" : "Pod::Wordlist" } }, "name" : "@Author::ZOFFIX/Test::PodSpelling", "version" : "2.007000" }, { "class" : "Dist::Zilla::Plugin::CheckSelfDependency", "config" : { "Dist::Zilla::Plugin::CheckSelfDependency" : { "finder" : [ ":InstallModules" ] }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000026", "version" : "0.003" } }, "name" : "@Author::ZOFFIX/CheckSelfDependency", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@Author::ZOFFIX/CheckPrereqsIndexed", "version" : "0.017" }, { "class" : "Dist::Zilla::Plugin::Test::MinimumVersion", "name" : "@Author::ZOFFIX/Test::MinimumVersion", "version" : "2.000006" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", "config" : { "Dist::Zilla::Plugin::CopyFilesFromRelease" : { "filename" : [ "README.md" ], "match" : [] } }, "name" : "@Author::ZOFFIX/CopyFilesFromRelease", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@Author::ZOFFIX/TestRelease", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::InstallRelease", "name" : "@Author::ZOFFIX/InstallRelease", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@Author::ZOFFIX/ConfirmRelease", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@Author::ZOFFIX/UploadToCPAN", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "TestRequires", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "requires" } }, "name" : "DevelopRequires", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::AutoMetaResources", "name" : "AutoMetaResources", "version" : "1.21" }, { "class" : "Dist::Zilla::Plugin::Meta::Contributors", "name" : "Meta::Contributors", "version" : "0.002" }, { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "config" : { "Dist::Zilla::Plugin::Git::NextVersion" : { "first_version" : "0.07", "version_by_branch" : 0, "version_regexp" : "(?^u:^(.+)$)" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "Git::NextVersion", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "0.14", "tag_format" : "%v", "tag_message" : "%v" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "Git::Tag", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "dist.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "Git::Check", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "v%v%n%n%c" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "dist.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "Git::Commit", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "config" : { "Dist::Zilla::Plugin::Git::Push" : { "push_to" : [ "origin" ], "remotes_must_exist" : 1 }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "Git::Push", "version" : "2.036" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "MetaJSON", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "5.043" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "@Author::ZOFFIX/MetaProvides::Package/AUTOVIV/:InstallModulesPM", "version" : "5.043" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : "0" }, "version" : "5.043" } }, "x_contributors" : [ "Kevin Ryde ", "Marcel Grünauer ", "Mike Doherty ", "Patrice Clement ", "Greg Sabino Mullane ", "Zoffix Znet ", "Olivier Mengué " ] } t000755001750001750 012660753207 14373 5ustar00zoffixzoffix000000000000Test-Synopsis-0.1406-for.t100644001750001750 17412660753207 15713 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/tno warnings; use Test::Synopsis; use Test::More tests => 2; synopsis_ok("lib/Test/Synopsis.pm"); is $main::for_checked, 1; Makefile.PL100644001750001750 306012660753207 16241 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.043. use strict; use warnings; use 5.008_001; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Test your SYNOPSIS code", "AUTHOR" => "Tatsuhiko Miyagawa ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "Test-Synopsis", "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.008_001", "NAME" => "Test::Synopsis", "PREREQ_PM" => { "ExtUtils::Manifest" => 0, "Pod::Simple" => 0, "Test::Builder::Module" => 0, "parent" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::Builder" => "0.34", "Test::Builder::Tester" => 0, "Test::More" => 0, "blib" => "1.01" }, "VERSION" => "0.14", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "ExtUtils::Manifest" => 0, "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Pod::Simple" => 0, "Test::Builder" => "0.34", "Test::Builder::Module" => 0, "Test::Builder::Tester" => 0, "Test::More" => 0, "blib" => "1.01", "parent" => 0, "strict" => 0, "warnings" => 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); 07-nopod.t100644001750001750 11612660753207 16241 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/tuse Test::More tests => 1; use Test::Synopsis; synopsis_ok("t/lib/NoPod.pm"); 04-HEREDOC.t100644001750001750 12612660753207 16171 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/tuse Test::More tests => 1; use Test::Synopsis; synopsis_ok("t/lib/Test04HEREDOC.pm"); lib000755001750001750 012660753207 15141 5ustar00zoffixzoffix000000000000Test-Synopsis-0.14/tNoPod.pm100644001750001750 52212660753207 16635 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/t/libpackage Test::Synopsis::__TestBait_NoPod; # Dummy module used during testing of Test::Synopsis. Needs to be in the lib/ # dir of the Test-Synopsis distribution to Test::Synopsis can find it. # # This module does not have a POD section at all; Test::Synopsis still # shouldn't warn even with -w. use strict; use warnings; # VERSION 1; 00-compile.t100644001750001750 233212660753207 16565 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/tuse 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.054 use Test::More; plan tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Test/Synopsis.pm' ); # no fake home requested my $inc_switch = -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; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-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}; 09-synopsis.t100644001750001750 10212660753207 17006 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/tuse Test::Synopsis; all_synopsis_ok(dump_all_code_on_error => 1); Test03.pm100644001750001750 36312660753207 16703 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/t/libpackage Test::Synopsis::__TestBait_Test03; # Dummy module used during testing of Test::Synopsis use strict; use warnings; # VERSION 1; =pod =head1 SYNOPSIS Testing stuff: BEGIN { our $Foo = 42; } sub foobar { return 1; } =cut author000755001750001750 012660753207 16065 5ustar00zoffixzoffix000000000000Test-Synopsis-0.14/xteol.t100644001750001750 202212660753207 17165 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/xt/authoruse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::EOL 0.18 use Test::More 0.88; use Test::EOL; my @files = ( 'lib/Test/Synopsis.pm', 't/00-compile.t', 't/01-fail-if-SYNOPSIS-has-errors.t', 't/02-END-token-errors.t', 't/03-end-in-pod.t', 't/04-HEREDOC.t', 't/05-multi-chunks-clash.t', 't/05-multi-files-clash.t', 't/06-for.t', 't/07-nopod.t', 't/08-plain-text-in-pod.t', 't/09-synopsis.t', 't/10-in-pod-skip.t', 't/11-DATA-in-pod.t', 't/12-DATA-token-errors.t', 't/lib/BrokenSYNOPSIS01.pm', 't/lib/ENDInPod.pm', 't/lib/ENDInPodWithError.pm', 't/lib/NoPod.pm', 't/lib/PlainTextInPod.pm', 't/lib/Test03.pm', 't/lib/Test03Other.pm', 't/lib/Test04HEREDOC.pm', 't/lib/Test10HEREDOC.pm', 't/lib/Test10InPodSkipWithBegin.pm', 't/lib/Test11DATAInPod.pm', 't/lib/Test12DATAInPodWithError.pm', 't/lib/TestMultipleChunks.pm' ); eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; done_testing; 03-end-in-pod.t100644001750001750 12112660753207 17044 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/tuse Test::More tests => 1; use Test::Synopsis; synopsis_ok("t/lib/ENDInPod.pm"); ENDInPod.pm100644001750001750 67612660753207 17170 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/t/libpackage Test::Synopsis::__TestBait_ENDinPod; # Dummy module used during testing of Test::Synopsis. Needs to be in the lib/ # dir of the Test-Synopsis distribution to Test::Synopsis can find it. # # This module has an __END__ in the synopsis code; it shouldn't # break Test::Synopsis use strict; use warnings; # VERSION 1; =pod =head1 SYNOPSIS Testing stuff: print "Foos!\n"; __END__ BLARGHS! =head1 DESCRIPTION bleh =cut 10-in-pod-skip.t100644001750001750 14112660753207 17244 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/tuse Test::More tests => 1; use Test::Synopsis; synopsis_ok("t/lib/Test10InPodSkipWithBegin.pm"); 11-DATA-in-pod.t100644001750001750 13012660753207 17006 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/tuse Test::More tests => 1; use Test::Synopsis; synopsis_ok("t/lib/Test11DATAInPod.pm"); no-tabs.t100644001750001750 177012660753207 17762 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/xt/authoruse 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/Test/Synopsis.pm', 't/00-compile.t', 't/01-fail-if-SYNOPSIS-has-errors.t', 't/02-END-token-errors.t', 't/03-end-in-pod.t', 't/04-HEREDOC.t', 't/05-multi-chunks-clash.t', 't/05-multi-files-clash.t', 't/06-for.t', 't/07-nopod.t', 't/08-plain-text-in-pod.t', 't/09-synopsis.t', 't/10-in-pod-skip.t', 't/11-DATA-in-pod.t', 't/12-DATA-token-errors.t', 't/lib/BrokenSYNOPSIS01.pm', 't/lib/ENDInPod.pm', 't/lib/ENDInPodWithError.pm', 't/lib/NoPod.pm', 't/lib/PlainTextInPod.pm', 't/lib/Test03.pm', 't/lib/Test03Other.pm', 't/lib/Test04HEREDOC.pm', 't/lib/Test10HEREDOC.pm', 't/lib/Test10InPodSkipWithBegin.pm', 't/lib/Test11DATAInPod.pm', 't/lib/Test12DATAInPodWithError.pm', 't/lib/TestMultipleChunks.pm' ); notabs_ok($_) foreach @files; done_testing; Test03Other.pm100644001750001750 52112660753207 17701 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/t/libpackage Test::Synopsis::__TestBait_Test03Other; # Dummy module used during testing of Test::Synopsis use strict; use warnings; # VERSION 1; =pod =head1 SYNOPSIS Testing stuff: BEGIN { no strict 'refs'; die "CLASHING!" if grep $_ eq 'Foo', keys %{ __PACKAGE__ .'::' }; } sub foobar { return 2; } =cut Test000755001750001750 012660753207 15615 5ustar00zoffixzoffix000000000000Test-Synopsis-0.14/libSynopsis.pm100644001750001750 2467112660753207 20174 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/lib/Testpackage Test::Synopsis; use strict; use warnings; use 5.008_001; our $VERSION = '0.14'; # VERSION use parent qw( Test::Builder::Module ); our @EXPORT = qw( synopsis_ok all_synopsis_ok ); use ExtUtils::Manifest qw( maniread ); my %ARGS; # = ( dump_all_code_on_error => 1 ); ### REMOVE THIS FOR PRODUCTION!!! sub all_synopsis_ok { %ARGS = @_; my $manifest = maniread(); my @files = grep m!^lib/.*\.p(od|m)$!, keys %$manifest or __PACKAGE__->builder->skip_all('No files in lib to test'); __PACKAGE__->builder->no_plan(); synopsis_ok(@files); } sub synopsis_ok { my @files = @_; for my $file (@files) { my $blocks = _extract_synopsis($file); unless (@$blocks) { __PACKAGE__->builder->ok(1, "No SYNOPSIS code"); next; } my $block_num = 0; for my $block (@$blocks) { $block_num++; my ($line, $code, $options) = @$block; # don't want __END__ blocks in SYNOPSIS chopping our '}' in wrapper sub # same goes for __DATA__ and although we'll be sticking an extra '}' # into its contents; it shouldn't matter since the code shouldn't be # run anyways. $code =~ s/(?=(?:__END__|__DATA__)\s*$)/}\n/m; $options = join(";", @$options); my $test = qq($options;\nsub{\n#line $line "$file"\n$code\n;}); #use Test::More (); Test::More::note "=========\n$test\n========"; my $ok = _compile($test); # See if the user is trying to skip this test using the =for block if ( !$ok and $@=~/^SKIP:.+BEGIN failed--compilation aborted/si ) { $@ =~ s/^SKIP:\s*//; $@ =~ s/\nBEGIN failed--compilation aborted at.+//s; __PACKAGE__->builder->skip($@, 1); } else { my $block_name = $file; ## Show block number only if more than one block if (@$blocks > 1) { $block_name .= " (section $block_num)"; } __PACKAGE__->builder->ok($ok, $block_name) or __PACKAGE__->builder->diag( $ARGS{dump_all_code_on_error} ? "$@\nEVALED CODE:\n$test" : $@ ); } } } } my $sandbox = 0; sub _compile { package Test::Synopsis::Sandbox; eval sprintf "package\nTest::Synopsis::Sandbox%d;\n%s", ++$sandbox, $_[0]; ## no critic } sub _extract_synopsis { my $file = shift; my $parser = Test::Synopsis::Parser->new; $parser->parse_file($file); $parser->{tsyn_blocks} } package Test::Synopsis::Parser; # on new line to avoid indexing use parent 'Pod::Simple'; sub new { my $self = shift->SUPER::new(@_); $self->accept_targets('test_synopsis'); $self->merge_text(1); $self->no_errata_section(1); $self->strip_verbatim_indent(sub { my $lines = shift; my ($indent) = $lines->[0] =~ /^(\s*)/; $indent }); $self->{tsyn_stack} = []; $self->{tsyn_options} = []; $self->{tsyn_blocks} = []; $self->{tsyn_in_synopsis} = ''; $self } sub _handle_element_start { my ($self, $element_name, $attrs) = @_; #Test::More::note Test::More::explain($element_name); #Test::More::note Test::More::explain($attrs); push @{$self->{tsyn_stack}}, [ $element_name, $attrs ]; } sub _handle_element_end { return unless $_[0]->{tsyn_stack}; pop @{ $_[0]->{tsyn_stack} }; } sub _handle_text { return unless $_[0]->{tsyn_stack}; my ($self, $text) = @_; my $elt = $self->{tsyn_stack}[-1][0]; if ($elt eq 'head1') { if ($self->{tsyn_in_synopsis}) { # Exiting SYNOPSIS => Skip everything to the end delete $self->{tsyn_stack}; } $self->{tsyn_in_synopsis} = $text =~ /SYNOPSIS\s*$/; } elsif ($elt eq 'Data') { # use Test::More; Test::More::note "XXX"; my $up = $self->{tsyn_stack}[-2]; if ($up->[0] eq 'for' && $up->[1]->{target} eq 'test_synopsis') { my $line = $up->[1]{start_line}; my $file = $self->source_filename; push @{$self->{tsyn_options}}, qq<#line $line "$file"\n$text\n>; } } elsif ($elt eq 'Verbatim' && $self->{tsyn_in_synopsis}) { my $line = $self->{tsyn_stack}[-1][1]{start_line}; push @{ $self->{tsyn_blocks} }, [ $line, $text, $self->{tsyn_options}, ]; $self->{tsyn_options} = []; } } 1; __END__ =encoding utf-8 =for stopwords Goro blogged Znet Zoffix DOHERTY Doherty KRYDE Ryde ZOFFIX Gr nauer Grünauer pm HEREDOC HEREDOCs =for test_synopsis $main::for_checked=1 =head1 NAME Test::Synopsis - Test your SYNOPSIS code =head1 SYNOPSIS # xt/synopsis.t (with Module::Install::AuthorTests) use Test::Synopsis; all_synopsis_ok(); # Or, run safe without Test::Synopsis use Test::More; eval "use Test::Synopsis"; plan skip_all => "Test::Synopsis required for testing" if $@; all_synopsis_ok(); =head1 DESCRIPTION Test::Synopsis is an (author) test module to find .pm or .pod files under your I directory and then make sure the example snippet code in your I section passes the perl compile check. Note that this module only checks the perl syntax (by wrapping the code with C) and doesn't actually run the code, B that code is a C block or a C statement. Suppose you have the following POD in your module. =head1 NAME Awesome::Template - My awesome template =head1 SYNOPSIS use Awesome::Template; my $template = Awesome::Template->new; $tempalte->render("template.at"); =head1 DESCRIPTION An user of your module would try copy-paste this synopsis code and find that this code doesn't compile because there's a typo in your variable name I<$tempalte>. Test::Synopsis will catch that error before you ship it. =head1 VARIABLE DECLARATIONS Sometimes you might want to put some undeclared variables in your synopsis, like: =head1 SYNOPSIS use Data::Dumper::Names; print Dumper($scalar, \@array, \%hash); This assumes these variables like I<$scalar> are defined elsewhere in module user's code, but Test::Synopsis, by default, will complain that these variables are not declared: Global symbol "$scalar" requires explicit package name at ... In this case, you can add the following POD sequence elsewhere in your POD: =for test_synopsis no strict 'vars' Or more explicitly, =for test_synopsis my($scalar, @array, %hash); Test::Synopsis will find these C<=for> blocks and these statements are prepended before your SYNOPSIS code when being evaluated, so those variable name errors will go away, without adding unnecessary bits in SYNOPSIS which might confuse users. =head1 SKIPPING TEST FROM INSIDE THE POD You can use a C block in the C<=for test_synopsis> to check for specific conditions (e.g. if a module is present), and possibly skip the test. If you C inside the C block and the die message begins with sequence C (note the colon at the end), the test will be skipped for that document. =head1 SYNOPSIS =for test_synopsis BEGIN { die "SKIP: skip this pod, it's horrible!\n"; } $x; # undeclared variable, but we skipped the test! =end =head1 EXPORTED SUBROUTINES =head2 C all_synopsis_ok(); all_synopsis_ok( dump_all_code_on_error => 1 ); Checks the SYNOPSIS code in all your modules. Takes B arguments as key/value pairs. Possible arguments are as follows: =head3 C all_synopsis_ok( dump_all_code_on_error => 1 ); Takes true or false values as a value. B false. When set to a true value, if an error is discovered in the SYNOPSIS code, the test will dump the entire snippet of code it tried to test. Use this if you want to copy/paste and play around with the code until the error is fixed. The dumped code will include any of the C<=for> code you specified (see L section above) as well as a few internal bits this test module uses to make SYNOPSIS code checking possible. B you will likely have to remove the C<#> and a space at the start of each line (C) =head2 C use Test::More tests => 1; use Test::Synopsis; synopsis_ok("t/lib/NoPod.pm"); synopsis_ok(qw/Pod1.pm Pod2.pm Pod3.pm/); Lets you test a single file. B you must setup your own plan if you use this subroutine (e.g. with C<< use Test::More tests => 1; >>). B a list of filenames for documents containing SYNOPSIS code to test. =head1 CAVEATS This module will not check code past the C<__END__> or C<__DATA__> tokens, if one is present in the SYNOPSIS code. This module will actually execute C statements and any code you specify in the C blocks in the SYNOPSIS. If you're using HEREDOCs in your SYNOPSIS, you will need to place the ending of the HEREDOC at the same indent as the first line of the code of your SYNOPSIS. Redefinition warnings can be turned off with =for test_synopsis no warnings 'redefine'; =head1 REPOSITORY Fork this module on GitHub: L =head1 BUGS To report bugs or request features, please use L If you can't access GitHub, you can email your request to C =head1 AUTHOR Tatsuhiko Miyagawa Emiyagawa@bulknews.netE Goro Fuji blogged about the original idea at L based on the testing code taken from L. =head1 MAINTAINER Zoffix Znet =head1 CONTRIBUTORS =over 4 =item * Kevin Ryde (L) =item * Marcel Grünauer (L) =item * Mike Doherty (L) =item * Patrice Clement (L) =item * Greg Sabino Mullane (L) =item * Zoffix Znet (L) =item * Olivier Mengué (L) =back =head1 LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 COPYRIGHT This library is Copyright (c) Tatsuhiko Miyagawa =head1 SEE ALSO L, L, L =cut mojibake.t100644001750001750 15112660753207 20150 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/xt/author#!perl use strict; use warnings qw(all); use Test::More; use Test::Mojibake; all_files_encoding_ok(); release000755001750001750 012660753207 16203 5ustar00zoffixzoffix000000000000Test-Synopsis-0.14/xtkwalitee.t100644001750001750 27512660753207 20321 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/xt/release# this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.12 use strict; use warnings; use Test::More 0.88; use Test::Kwalitee 1.21 'kwalitee_ok'; kwalitee_ok(); done_testing; distmeta.t100644001750001750 17212660753207 20322 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/xt/release#!perl # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. use Test::CPAN::Meta; meta_yaml_ok(); synopsis.t100644001750001750 6012660753207 20353 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/xt/release#!perl use Test::Synopsis; all_synopsis_ok(); pod-spell.t100644001750001750 66212660753207 20275 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/xt/authoruse strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007000 use Test::Spelling 0.12; use Pod::Wordlist; add_stopwords(); all_pod_files_spelling_ok( qw( bin lib ) ); __DATA__ Tatsuhiko Miyagawa miyagawa Kevin Ryde kryde Marcel Grünauer marcel Mike Doherty doherty Patrice Clement monsieurp Greg Sabino Mullane turnstep Zoffix Znet zoffix Olivier Mengué dolmen lib Test Synopsis Test04HEREDOC.pm100644001750001750 35312660753207 17675 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/t/libpackage Test::Synopsis::__TestBait_Test04HEREDOC; # Dummy module used during testing of Test::Synopsis use strict; use warnings; # VERSION 1; =pod =head1 SYNOPSIS Testing stuff: my $x = <<'END'; blargs END =cut Test10HEREDOC.pm100644001750001750 35312660753207 17672 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/t/libpackage Test::Synopsis::__TestBait_Test10HEREDOC; # Dummy module used during testing of Test::Synopsis use strict; use warnings; # VERSION 1; =pod =head1 SYNOPSIS Testing stuff: my $x = <<'END'; blargs END =cut meta-json.t100644001750001750 6412660753207 20365 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/xt/release#!perl use Test::CPAN::Meta::JSON; meta_json_ok(); pod-syntax.t100644001750001750 25212660753207 20477 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/xt/author#!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(); 02-END-token-errors.t100644001750001750 112612660753207 20175 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/tuse Test::Builder::Tester tests => 1; use Test::More; use Test::Synopsis; # Test whether we indeed can detect errors in SYNOPSIS codes test_out('not ok 1 - t/lib/ENDInPodWithError.pm'); test_diag(q{ Failed test 't/lib/ENDInPodWithError.pm'}, q{ at t/02-END-token-errors.t line } . line_num(+9) . q{.}, q{Global symbol "$x" requires explicit package name} . ( ($^V and $^V gt 5.21.3) ? ' (did you forget to declare "my $x"?)' : '' ) . q{ at t/lib/ENDInPodWithError.pm line 24.}, ); synopsis_ok("t/lib/ENDInPodWithError.pm"); test_test("synopsis fail works"); PlainTextInPod.pm100644001750001750 72712660753207 20467 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/t/libpackage Test::Synopsis::__TestBait_PlainTextInPod; # Dummy module used during testing of Test::Synopsis. Needs to be in the lib/ # dir of the Test-Synopsis distribution to Test::Synopsis can find it. # # This module has plain text in the middle of the SYNOPSIS code; we should # ignore it use strict; use warnings; # VERSION 1; =pod =head1 SYNOPSIS Print some foos: print "Foos!\n"; Blarg away: BLARGHS(); MOAR BLARGHS! =head1 DESCRIPTION bleh =cut 08-plain-text-in-pod.t100644001750001750 12712660753207 20376 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/tuse Test::More tests => 2; use Test::Synopsis; synopsis_ok("t/lib/PlainTextInPod.pm"); 12-DATA-token-errors.t100644001750001750 116312660753207 20302 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/tuse Test::Builder::Tester tests => 1; use Test::More; use Test::Synopsis; # Test whether we indeed can detect errors in SYNOPSIS codes test_out('not ok 1 - t/lib/Test12DATAInPodWithError.pm'); test_diag(q{ Failed test 't/lib/Test12DATAInPodWithError.pm'}, q{ at t/12-DATA-token-errors.t line } . line_num(+9) . q{.}, q{Global symbol "$x" requires explicit package name} . ( ($^V and $^V gt 5.21.3) ? ' (did you forget to declare "my $x"?)' : '' ) . q{ at t/lib/Test12DATAInPodWithError.pm line 24.}, ); synopsis_ok("t/lib/Test12DATAInPodWithError.pm"); test_test("synopsis fail works"); 05-multi-files-clash.t100644001750001750 26012660753207 20442 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/tuse Test::More tests => 2; use Test::Synopsis; # Test tests whether SYNOPSIS in separate files clashes # See RT#76856 synopsis_ok("t/lib/Test03.pm", "t/lib/Test03Other.pm"); Test11DATAInPod.pm100644001750001750 72212660753207 20265 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/t/libpackage Test::Synopsis::__TestBait_Test11DATAInPod; # Dummy module used during testing of Test::Synopsis. Needs to be in the lib/ # dir of the Test-Synopsis distribution to Test::Synopsis can find it. # # This module has a __DATA__ in the synopsis code; it shouldn't # break Test::Synopsis use strict; use warnings; # VERSION 1; =pod =head1 SYNOPSIS Testing stuff: print "Foos!\n"; __DATA__ $x; # uninitialized! =head1 DESCRIPTION bleh =cut test-version.t100644001750001750 64012660753207 21034 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/xt/authoruse strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::Version 1.05 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; pod-coverage.t100644001750001750 33412660753207 20745 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/xt/author#!perl # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. use Test::Pod::Coverage 1.08; use Pod::Coverage::TrustPod; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); portability.t100644001750001750 27712660753207 21060 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/xt/release#!perl use strict; use warnings; use Test::More; eval 'use Test::Portability::Files'; plan skip_all => 'Test::Portability::Files required for testing portability' if $@; run_tests(); 05-multi-chunks-clash.t100644001750001750 75312660753207 20642 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/tuse Test::Builder::Tester tests => 1; use Test::More; use Test::Synopsis; test_out('ok 1 - t/lib/TestMultipleChunks.pm (section 1) not ok 2 - t/lib/TestMultipleChunks.pm (section 2)'); test_diag(q{ Failed test 't/lib/TestMultipleChunks.pm (section 2)' # at t/05-multi-chunks-clash.t line 12. # Bareword "bob" not allowed while "strict subs" in use at t/lib/TestMultipleChunks.pm line 29.}); synopsis_ok("t/lib/TestMultipleChunks.pm"); test_test("synopsis with multiple chunks fails"); BrokenSYNOPSIS01.pm100644001750001750 35612660753207 20414 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/t/libpackage Test::Synopsis::__TestBait_BrokenSYNOPSIS01; # Used by 01-fail-if-SYNOPSIS-has-errors.t use strict; use warnings; # VERSION 1; =pod =head1 SYNOPSIS print "Foos!\n"; $x; # undeclared =head1 DESCRIPTION bleh =cut cpan-changes.t100644001750001750 26312660753207 21040 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/xt/release#!perl use strict; use warnings; use Test::More 0.96 tests => 2; use_ok('Test::CPAN::Changes'); subtest 'changes_ok' => sub { changes_file_ok('Changes'); }; done_testing(); ENDInPodWithError.pm100644001750001750 74312660753207 21031 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/t/libpackage Test::Synopsis::__TestBait_ENDinPodWithError; # Dummy module used during testing of Test::Synopsis. Needs to be in the lib/ # dir of the Test-Synopsis distribution to Test::Synopsis can find it. # # This module does not has an __END__ in the synopsis code; it should # break Test::Synopsis use strict; use warnings; # VERSION 1; =pod =head1 SYNOPSIS Testing stuff: print "Foos!\n"; $x; # undeclared __END__ BLARGHS! =head1 DESCRIPTION bleh =cut dist-manifest.t100644001750001750 23012660753207 21252 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/xt/release#!perl use Test::More; eval "use Test::DistManifest"; plan skip_all => "Test::DistManifest required for testing the manifest" if $@; manifest_ok(); TestMultipleChunks.pm100644001750001750 63412660753207 21431 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/t/libpackage Test::Synopsis::__TestBait_TestMultipleChunks; # Dummy module used during testing of Test::Synopsis use strict; use warnings; # VERSION 1; =pod =head1 SYNOPSIS =for test_synopsis use warnings FATAL => 'all'; First sample code: my $x = 42; my $secondline = 1; my $fourthline = 4; Second sample code: my $x = 43; my $fourthline = 0; bob; =head1 DESCRIPTION bleh =cut minimum-version.t100644001750001750 27112660753207 21646 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/xt/release#!perl use Test::More; eval "use Test::MinimumVersion"; plan skip_all => "Test::MinimumVersion required for testing minimum versions" if $@; all_minimum_version_ok( qq{5.008008} ); Test12DATAInPodWithError.pm100644001750001750 75312660753207 22140 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/t/libpackage Test::Synopsis::__TestBait_Test11DATAInPod; # Dummy module used during testing of Test::Synopsis. Needs to be in the lib/ # dir of the Test-Synopsis distribution to Test::Synopsis can find it. # # This module has a __DATA__ in the synopsis code along with an error # that Test::Synopsis should be detecting use strict; use warnings; # VERSION 1; =pod =head1 SYNOPSIS Testing stuff: print "Foos!\n"; $x; # uninitialized! __DATA__ =head1 DESCRIPTION bleh =cut Test10InPodSkipWithBegin.pm100644001750001750 41312660753207 22257 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/t/libpackage Test::Synopsis::__TestBait_Test10InPodSkipWithBegin; # Dummy module used during testing of Test::Synopsis use strict; use warnings; # VERSION 1; =pod =head1 SYNOPSIS =for test_synopsis BEGIN { die "SKIP: testing skipping stuff \\o/\n"; } $x; =cut 01-fail-if-SYNOPSIS-has-errors.t100644001750001750 115412660753207 22016 0ustar00zoffixzoffix000000000000Test-Synopsis-0.14/tuse Test::Builder::Tester tests => 1; use Test::More; use Test::Synopsis; # Test whether we indeed can detect errors in SYNOPSIS codes test_out('not ok 1 - t/lib/BrokenSYNOPSIS01.pm'); test_diag(q{ Failed test 't/lib/BrokenSYNOPSIS01.pm'}, q{ at t/01-fail-if-SYNOPSIS-has-errors.t line } . line_num(+9) . q{.}, q{Global symbol "$x" requires explicit package name} . ( ($^V and $^V gt 5.21.3) ? ' (did you forget to declare "my $x"?)' : '' ) . q{ at t/lib/BrokenSYNOPSIS01.pm line 18.}, ); synopsis_ok("t/lib/BrokenSYNOPSIS01.pm"); test_test("synopsis fail works");