PaxHeader/Test-Mojibake-1.3000755 777777 777777 00000000213 13046111753 021242 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838555 19 SCHILY.nlink=16 Test-Mojibake-1.3/000755 €)®ô˜€)—Ue00000000000 13046111753 020360 5ustar00spoussepCORPAD\Domain Users000000 000000 Test-Mojibake-1.3/PaxHeader/bin000755 777777 777777 00000000212 13046111753 022011 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838587 18 SCHILY.nlink=3 Test-Mojibake-1.3/bin/000755 €)®ô˜€)—Ue00000000000 13046111753 021130 5ustar00spoussepCORPAD\Domain Users000000 000000 Test-Mojibake-1.3/PaxHeader/Changes000644 777777 777777 00000000212 13046111753 022606 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838558 18 SCHILY.nlink=1 Test-Mojibake-1.3/Changes000644 €)®ô˜€)—Ue00000004573 13046111753 021664 0ustar00spoussepCORPAD\Domain Users000000 000000 Changelog for Test-Mojibake 1.3 2017-02-06T15:19:06 - Fixing SYNOPSIS (Stanislaw Pusep) 1.2 2017-02-06T14:37:11 - Minor fixes to pass the release tests (Stanislaw Pusep) - Add MetaJSON plugin [#12] (John SJ Anderson) - Add new optional dependency on Unicode::CheckUTF8::PP, a Pure Perl implementation of Unicode::CheckUTF8 (Hunter McMillen) - Fixed off-by-one pointed by Dave Rolsky at issue #10 (Stanislaw Pusep) 1.1 2015-09-03T10:03:33 - Distribution maintenance (Stanislaw Pusep) - Handle the case where all_files_encoding_ok has no files to test by skipping all tests (Dave Rolsky) 1.0 2014-05-20T09:51:17 - Use proper source for ASCII-only characters (Stanislaw Pusep) - Dist::Zilla-related updates (Stanislaw Pusep) - Fixing the "comment in regexp" other way around (Stanislaw Pusep) - Fix regex to properly ignore comments (Karen Etheridge) 0.9 2014-01-17T15:20:23 - More consistent UTF-8 naming in docs[2] (Stanislaw Pusep) - More consistent UTF-8 naming in docs (Stanislaw Pusep) - Dist::Zilla maintenance (Stanislaw Pusep) - Fixed issue #7 (Stanislaw Pusep) 0.8 2013-01-26T20:27:16 - fixed cyclic t/ deps (Stanislaw Pusep) - added the standalone scan_mojibake utility (Stanislaw Pusep) - listed Unicode::CheckUTF8 as a recommended prerequisite (Stanislaw Pusep) - recognize utf8::all (Stanislaw Pusep) - passes perlcritic harsh (Stanislaw Pusep) 0.7 2012-10-01T14:04:58 - fixed multiple =encoding behavior; more deterministic t/01-bad-check.t (Stanislaw Pusep) 0.6 2012-09-28T21:53:42 - fixed incorrect test examples (shame on me!) (Stanislaw Pusep) 0.5 2012-09-27T12:17:20 - Attempt to fix https://github.com/creaktive/Test-Mojibake/issues/2 (Stanislaw Pusep) - Kwalitee won't complain any more (Stanislaw Pusep) 0.4 2012-06-25T19:24:34 - version bump (Stanislaw Pusep) - _detect_utf8: PP version now handles overlong UTF-8 sequences (Stanislaw Pusep) - tests update (96% coverage) (Stanislaw Pusep) - Dist::Zilla update (Stanislaw Pusep) 0.3 2011-05-23T13:49:05 - Better tests. (Stanislaw Pusep) - Fixed 05-encode.t due to CPAN Testers reports. (Stanislaw Pusep) 0.2 2011-05-19T13:41:01 - Added optional Unicode::CheckUTF8 support. (Stanislaw Pusep) - eval{} EPIC FAIL! (Stanislaw Pusep) - POD. (Stanislaw Pusep) 0.1 2011-05-17T17:52:13 - Documentation, tests[2]. (Stanislaw Pusep) - Documentation, tests. (Stanislaw Pusep) - 0.1 (Stanislaw Pusep) Test-Mojibake-1.3/PaxHeader/dist.ini000644 777777 777777 00000000212 13046111753 022757 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838559 18 SCHILY.nlink=1 Test-Mojibake-1.3/dist.ini000644 €)®ô˜€)—Ue00000002227 13046111753 022027 0ustar00spoussepCORPAD\Domain Users000000 000000 name = Test-Mojibake author = Stanislaw Pusep license = Perl_5 copyright_holder = Stanislaw Pusep ; copyright_year = 2014 ; authordep Perl::Critic::Policy::Modules::ProhibitModuleShebang ; authordep Pod::Elemental::Transformer::List [@Git] [@Basic] [Git::NextVersion] [ChangelogFromGit::CPAN::Changes] file_name = Changes max_age = 500 copy_to_root = 0 [ContributorsFromGit] [OurPkgVersion] [MetaResourcesFromGit] homepage = https://github.com/%a/%r bugtracker.web = https://github.com/%a/%r/issues [@TestingMania] critic_config = perlcritic.rc [PodWeaver] [ReadmeAnyFromPod / text.build] filename = README type = text [ReadmeAnyFromPod / pod.root] filename = README.pod type = pod [CopyFilesFromBuild] move = README.pod [FileFinder::ByName / SafeTests] file = t/*.t [AutoPrereqs] test_finder = SafeTests [Prereqs / RuntimeRecommends] Unicode::CheckUTF8 = 0 Unicode::CheckUTF8::PP = 0 [MinimumPerl] perl = 5.006 [ManifestSkip] [MetaJSON]Test-Mojibake-1.3/PaxHeader/lib000755 777777 777777 00000000212 13046111753 022007 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838604 18 SCHILY.nlink=3 Test-Mojibake-1.3/lib/000755 €)®ô˜€)—Ue00000000000 13046111753 021126 5ustar00spoussepCORPAD\Domain Users000000 000000 Test-Mojibake-1.3/PaxHeader/LICENSE000644 777777 777777 00000000212 13046111753 022320 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838557 18 SCHILY.nlink=1 Test-Mojibake-1.3/LICENSE000644 €)®ô˜€)—Ue00000043666 13046111753 021404 0ustar00spoussepCORPAD\Domain Users000000 000000 This software is copyright (c) 2017 by Stanislaw Pusep. 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) 2017 by Stanislaw Pusep. 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) 2017 by Stanislaw Pusep. 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 Test-Mojibake-1.3/PaxHeader/Makefile.PL000644 777777 777777 00000000212 13046111753 023265 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838567 18 SCHILY.nlink=1 Test-Mojibake-1.3/Makefile.PL000644 €)®ô˜€)—Ue00000003140 13046111753 022330 0ustar00spoussepCORPAD\Domain Users000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.008. use strict; use warnings; use 5.006; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "check your source for encoding misbehavior.", "AUTHOR" => "Stanislaw Pusep ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "Test-Mojibake", "EXE_FILES" => [ "bin/scan_mojibake" ], "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.006", "NAME" => "Test::Mojibake", "PREREQ_PM" => { "File::Spec::Functions" => 0, "Pod::Usage" => 0, "Test::Builder" => 0, "bytes" => 0, "integer" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "Encode" => 0, "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::Builder::Tester" => 0, "Test::More" => 0, "blib" => "1.01" }, "VERSION" => "1.3", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Encode" => 0, "File::Spec" => 0, "File::Spec::Functions" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Pod::Usage" => 0, "Test::Builder" => 0, "Test::Builder::Tester" => 0, "Test::More" => 0, "blib" => "1.01", "bytes" => 0, "integer" => 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); Test-Mojibake-1.3/PaxHeader/MANIFEST000644 777777 777777 00000000212 13046111753 022444 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838561 18 SCHILY.nlink=1 Test-Mojibake-1.3/MANIFEST000644 €)®ô˜€)—Ue00000002150 13046111753 021507 0ustar00spoussepCORPAD\Domain Users000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.008. Changes LICENSE MANIFEST MANIFEST.SKIP META.json META.yml Makefile.PL README bin/scan_mojibake dist.ini lib/Test/Mojibake.pm perlcritic.rc t/00-compile.t t/00-load.t t/01-bad-check.t t/01-self-check.t t/01-test-check.t t/02-bad-source.t t/02-good-source.t t/03-bad-pod.t t/03-good-pod.t t/04-bom.t t/05-encode.t t/06-pp-vs-xs.t t/07-broken-utf8.t t/08-all-files-none-found.t t/author-critic.t t/author-eol.t t/author-mojibake.t t/author-no-tabs.t t/author-pod-coverage.t t/author-pod-linkcheck.t t/author-pod-syntax.t t/author-portability.t t/author-synopsis.t t/author-test-version.t t/bad/bad-latin1.pl_ t/bad/bad-latin1.pod_ t/bad/bad-utf8.pl_ t/bad/bad-utf8.pod_ t/bad/bom.pl_ t/bad/mojibake.pod_ t/good/Makefile.PL t/good/README t/good/ascii.pl t/good/ascii.pod t/good/latin1.pl t/good/latin1.pod t/good/mojibake.pl_ t/good/shebang t/good/utf8.pl_ t/good/utf8.pod t/release-cpan-changes.t t/release-dist-manifest.t t/release-distmeta.t t/release-kwalitee.t t/release-meta-json.t t/release-minimum-version.t t/release-unused-vars.t weaver.ini Test-Mojibake-1.3/PaxHeader/MANIFEST.SKIP000644 777777 777777 00000000212 13046111753 023211 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838568 18 SCHILY.nlink=1 Test-Mojibake-1.3/MANIFEST.SKIP000644 €)®ô˜€)—Ue00000001767 13046111753 022271 0ustar00spoussepCORPAD\Domain Users000000 000000 #!start included /Users/stas/perl5/perlbrew/perls/perl-5.16.2/lib/5.16.2/ExtUtils/MANIFEST.SKIP # Avoid version control files. \bRCS\b \bCVS\b \bSCCS\b ,v$ \B\.svn\b \B\.git\b \B\.gitignore\b \b_darcs\b \B\.cvsignore$ # Avoid VMS specific MakeMaker generated files \bDescrip.MMS$ \bDESCRIP.MMS$ \bdescrip.mms$ # Avoid Makemaker generated and utility files. \bMANIFEST\.bak \bMakefile$ \bblib/ \bMakeMaker-\d \bpm_to_blib\.ts$ \bpm_to_blib$ \bblibdirs\.ts$ # 6.18 through 6.25 generated this # Avoid Module::Build generated and utility files. \bBuild$ \b_build/ \bBuild.bat$ \bBuild.COM$ \bBUILD.COM$ \bbuild.com$ # Avoid temp and backup files. ~$ \.old$ \#$ \b\.# \.bak$ \.tmp$ \.# \.rej$ # Avoid OS-specific files/dirs # Mac OSX metadata \B\.DS_Store # Mac OSX SMB mount metadata files \B\._ # Avoid Devel::Cover and Devel::CoverX::Covered files. \bcover_db\b \bcovered\b # Avoid MYMETA files ^MYMETA\. #!end included /Users/stas/perl5/perlbrew/perls/perl-5.16.2/lib/5.16.2/ExtUtils/MANIFEST.SKIP Test-Mojibake-1.3/PaxHeader/META.json000644 777777 777777 00000000212 13046111753 022734 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838562 18 SCHILY.nlink=1 Test-Mojibake-1.3/META.json000644 €)®ô˜€)—Ue00000005242 13046111753 022004 0ustar00spoussepCORPAD\Domain Users000000 000000 { "abstract" : "check your source for encoding misbehavior.", "author" : [ "Stanislaw Pusep " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.008, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Test-Mojibake", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0", "perl" : "5.006" } }, "develop" : { "requires" : { "Pod::Coverage::TrustPod" : "0", "Test::CPAN::Changes" : "0.19", "Test::CPAN::Meta" : "0", "Test::CPAN::Meta::JSON" : "0.16", "Test::EOL" : "0", "Test::Kwalitee" : "1.21", "Test::MinimumVersion" : "0", "Test::Mojibake" : "0", "Test::More" : "0.88", "Test::NoTabs" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "Test::Pod::LinkCheck" : "0", "Test::Portability::Files" : "0", "Test::Synopsis" : "0", "Test::Version" : "1" } }, "runtime" : { "recommends" : { "Unicode::CheckUTF8" : "0", "Unicode::CheckUTF8::PP" : "0" }, "requires" : { "File::Spec::Functions" : "0", "Pod::Usage" : "0", "Test::Builder" : "0", "bytes" : "0", "integer" : "0", "perl" : "5.006", "strict" : "0", "warnings" : "0" } }, "test" : { "requires" : { "Encode" : "0", "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Test::Builder::Tester" : "0", "Test::More" : "0", "blib" : "1.01", "perl" : "5.006" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/creaktive/Test-Mojibake/issues" }, "homepage" : "https://github.com/creaktive/Test-Mojibake", "repository" : { "type" : "git", "url" : "git://github.com/creaktive/Test-Mojibake.git", "web" : "https://github.com/creaktive/Test-Mojibake" } }, "version" : "1.3", "x_contributors" : [ "Dave Rolsky ", "Hunter McMillen ", "John SJ Anderson ", "Karen Etheridge " ], "x_serialization_backend" : "Cpanel::JSON::XS version 3.0225" } Test-Mojibake-1.3/PaxHeader/META.yml000644 777777 777777 00000000212 13046111753 022564 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838560 18 SCHILY.nlink=1 Test-Mojibake-1.3/META.yml000644 €)®ô˜€)—Ue00000002271 13046111753 021633 0ustar00spoussepCORPAD\Domain Users000000 000000 --- abstract: 'check your source for encoding misbehavior.' author: - 'Stanislaw Pusep ' build_requires: Encode: '0' File::Spec: '0' IO::Handle: '0' IPC::Open3: '0' Test::Builder::Tester: '0' Test::More: '0' blib: '1.01' perl: '5.006' configure_requires: ExtUtils::MakeMaker: '0' perl: '5.006' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.008, 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: Test-Mojibake recommends: Unicode::CheckUTF8: '0' Unicode::CheckUTF8::PP: '0' requires: File::Spec::Functions: '0' Pod::Usage: '0' Test::Builder: '0' bytes: '0' integer: '0' perl: '5.006' strict: '0' warnings: '0' resources: bugtracker: https://github.com/creaktive/Test-Mojibake/issues homepage: https://github.com/creaktive/Test-Mojibake repository: git://github.com/creaktive/Test-Mojibake.git version: '1.3' x_contributors: - 'Dave Rolsky ' - 'Hunter McMillen ' - 'John SJ Anderson ' - 'Karen Etheridge ' x_serialization_backend: 'YAML::Tiny version 1.70' Test-Mojibake-1.3/PaxHeader/perlcritic.rc000644 777777 777777 00000000212 13046111753 024001 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838569 18 SCHILY.nlink=1 Test-Mojibake-1.3/perlcritic.rc000644 €)®ô˜€)—Ue00000000337 13046111753 023051 0ustar00spoussepCORPAD\Domain Users000000 000000 severity = harsh [TestingAndDebugging::RequireUseWarnings] equivalent_modules = common::sense [TestingAndDebugging::RequireUseStrict] equivalent_modules = common::sense [Modules::ProhibitModuleShebang] severity = gentle Test-Mojibake-1.3/PaxHeader/README000644 777777 777777 00000000212 13046111753 022173 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838556 18 SCHILY.nlink=1 Test-Mojibake-1.3/README000644 €)®ô˜€)—Ue00000016377 13046111753 021256 0ustar00spoussepCORPAD\Domain Users000000 000000 NAME Test::Mojibake - check your source for encoding misbehavior. VERSION version 1.3 SYNOPSIS # Test::Mojibake lets you check for inconsistencies in source/documentation encoding, and report its results in standard Test::Simple fashion. no strict 'vars'; use Test::Mojibake; file_encoding_ok($file, 'Valid encoding'); done_testing($num_tests); DESCRIPTION Many modern text editors automatically save files using UTF-8 codification, however, perl interpreter does not expects it by default. Whereas this does not represent a big deal on (most) backend-oriented programs, Web framework (Catalyst , Mojolicious ) based applications will suffer of so-called Mojibake (lit. "unintelligible sequence of characters"). Even worse: if an editor saves BOM (Byte Order Mark, U+FEFF character in Unicode) at the start of the script with executable bit set (on Unix systems), it won't execute at all, due to shebang corruption. Avoiding codification problems is quite simple: * Always use utf8/use common::sense when saving source as UTF-8; * Always specify =encoding UTF-8 when saving POD as UTF-8; * Do neither of above when saving as ISO-8859-1; * Never save BOM (not that it's wrong; just avoid it as you'll barely notice it's presence when in trouble). However, if you find yourself upgrading old code to use UTF-8 or trying to standardize a big project with many developers each one using a different platform/editor, reviewing all files manually can be quite painful. Specially in cases when some files have multiple encodings (note: it all started when I realized that Gedit & derivatives are unable to open files with character conversion tables). Enter the Test::Mojibake ;) FUNCTIONS file_encoding_ok( FILENAME[, TESTNAME ] ) Validates the codification of FILENAME. When it fails, file_encoding_ok() will report the probable cause. The optional second argument TESTNAME is the name of the test. If it is omitted, file_encoding_ok() chooses a default test name "Mojibake test for FILENAME". all_files_encoding_ok( [@entries] ) Validates codification of all the files under @entries. It runs all_files() on directories and assumes everything else to be a file to be tested. It calls the plan() function for you (one test for each file), so you can't have already called plan. If @entries is empty or not passed, the function finds all source/documentation files in files in the blib directory if it exists, or the lib directory if not. A source/documentation file is one that ends with .pod, .pl and .pm, or any file where the first line looks like a shebang line. all_files( [@dirs] ) Returns a list of all the Perl files in @dirs and in directories below. If no directories are passed, it defaults to blib if blib exists, or else lib if not. Skips any files in CVS, .svn, .git and similar directories. See %Test::Mojibake::ignore_dirs for a list of them. A Perl file is: * Any file that ends in .PL, .pl, .pm, .pod, or .t; * Any file that has a first line with a shebang and "perl" on it; * Any file that ends in .bat and has a first line with "--*-Perl-*--" on it. The order of the files returned is machine-dependent. If you want them sorted, you'll have to sort them yourself. _detect_utf8( \$string ) Detects presence of UTF-8 encoded characters in a referenced octet stream. Return codes: * 0 - 8-bit characters detected, does not validate as UTF-8; * 1 - only 7-bit characters; * 2 - 8-bit characters detected, validates as UTF-8. Unicode::CheckUTF8 is highly recommended, however, it is optional and this function will fallback to the Pure Perl implementation of the following PHP code: http://www.php.net/manual/en/function.utf8-encode.php#85293 SAMPLE TEST SCRIPT Module authors can include the following in a t/mojibake.t file and have Test::Mojibake automatically find and check all source files in a module distribution: #!perl -T use strict; BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval 'use Test::Mojibake'; plan skip_all => 'Test::Mojibake required for source encoding testing' if $@; all_files_encoding_ok(); OPERATION Test::Mojibake validates codification of both source (Perl code) and documentation (POD). Both are assumed to be encoded in ISO-8859-1 (aka latin1). Perl switches to UTF-8 through the statement: use utf8; or: use utf8::all; or even: use common::sense; Similarly, POD encoding can be changed via: =encoding UTF-8 Correspondingly, no utf8/=encoding latin1 put Perl back into ISO-8859-1 mode. Actually, Test::Mojibake only cares about UTF-8, as it is roughly safe to be detected. So, when UTF-8 characters are detected without preceding declaration, an error is reported. On the other way, non-UTF-8 characters in UTF-8 mode are wrong, either. If present, Unicode::CheckUTF8 module (XS wrapper) will be used to validate UTF-8 strings, note that it is 30 times faster and a lot more Unicode Consortium compliant than the built-in Pure Perl implementation! UTF-8 BOM (Byte Order Mark) is also detected as an error. While Perl is OK handling BOM, your OS probably isn't. Check out: ./bom.pl: line 1: $'\357\273\277#!/usr/bin/perl': command not found Caveats Whole-line source comments, like: # this is a whole-line comment... print "### hello world ###\n"; # ...and this os not are not checked at all. This is mainly because many scripts/modules do contain authors' names in headers, before the proper encoding specification. So, if you happen to have some acutes/umlauts in your name and your editor sign your code in the similar way, you probably won't be happy with Test::Mojibake flooding you with (false) error messages. If you are wondering why only whole-line comments are stripped, check the second line of the above example. SEE ALSO * scan_mojibake * common::sense * utf8::all * Dist::Zilla::Plugin::MojibakeTests * Test::Perl::Critic * Test::Pod * Test::Pod::Coverage * Test::Kwalitee ACKNOWLEDGEMENTS This module is based on Test::Pod. Thanks to Andy Lester, David Wheeler, Paul Miller and Peter Edwards for contributions and to brian d foy for the original code. AUTHOR Stanislaw Pusep COPYRIGHT AND LICENSE This software is copyright (c) 2017 by Stanislaw Pusep. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. CONTRIBUTORS * Dave Rolsky * Hunter McMillen * John SJ Anderson * Karen Etheridge Test-Mojibake-1.3/PaxHeader/t000755 777777 777777 00000000213 13046111753 021505 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838564 19 SCHILY.nlink=35 Test-Mojibake-1.3/t/000755 €)®ô˜€)—Ue00000000000 13046111753 020623 5ustar00spoussepCORPAD\Domain Users000000 000000 Test-Mojibake-1.3/PaxHeader/weaver.ini000644 777777 777777 00000000212 13046111753 023305 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838563 18 SCHILY.nlink=1 Test-Mojibake-1.3/weaver.ini000644 €)®ô˜€)—Ue00000000076 13046111753 022355 0ustar00spoussepCORPAD\Domain Users000000 000000 [@Default] [-Transformer] transformer = List [Contributors] Test-Mojibake-1.3/t/PaxHeader/00-compile.t000644 777777 777777 00000000212 13046111753 023610 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838577 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/00-compile.t000644 €)®ô˜€)—Ue00000005104 13046111753 022655 0ustar00spoussepCORPAD\Domain Users000000 000000 use 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.056 use Test::More; plan tests => 2 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Test/Mojibake.pm' ); my @scripts = ( 'bin/scan_mojibake' ); # 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; } } foreach my $file (@scripts) { SKIP: { open my $fh, '<', $file or warn("Unable to open $file: $!"), next; my $line = <$fh>; close $fh and skip("$file isn't perl", 1) unless $line =~ /^#!\s*(?:\S*perl\S*)((?:\s+-\w*)*)(?:\s*#.*)?$/; @switches = (@switches, split(' ', $1)) if $1; my $stderr = IO::Handle->new; diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } $^X, @switches, '-c', $file)) if $ENV{PERL_COMPILE_TEST_DEBUG}; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-c', $file); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$file compiled ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { require blib; blib->VERSION('1.01') }; # in older perls, -c output is simply the file portion of the path being tested if (@_warnings = grep { !/\bsyntax OK$/ } grep { chomp; $_ ne (File::Spec->splitpath($file))[2] } @_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}; Test-Mojibake-1.3/t/PaxHeader/00-load.t000644 777777 777777 00000000212 13046111753 023077 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838566 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/00-load.t000644 €)®ô˜€)—Ue00000000423 13046111753 022143 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use strict; use warnings qw(all); use Test::More tests => 2; BEGIN { use_ok(q(Test::Builder)); use_ok(q(Test::Mojibake)); } diag(qq(Testing Test::Mojibake v$Test::Mojibake::VERSION, Perl $], $^X)); diag(qq(Using Test::Builder v$Test::Builder::VERSION)); Test-Mojibake-1.3/t/PaxHeader/01-bad-check.t000644 777777 777777 00000000212 13046111753 023762 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838584 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/01-bad-check.t000644 €)®ô˜€)—Ue00000001444 13046111753 023032 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use strict; use warnings qw(all); use Test::Builder::Tester tests => 1; use Test::More; use Test::Mojibake; BAD: { ## no critic (ProhibitNoWarnings) no warnings qw(redefine); *Test::Builder::plan = sub {}; test_out( qq(not ok 1 - Mojibake test for t/bad/bad-latin1.pl_), qq(not ok 2 - Mojibake test for t/bad/bad-latin1.pod_), qq(not ok 3 - Mojibake test for t/bad/bad-utf8.pl_), qq(not ok 4 - Mojibake test for t/bad/bad-utf8.pod_), qq(not ok 5 - Mojibake test for t/bad/bom.pl_), qq(not ok 6 - Mojibake test for t/bad/mojibake.pod_) ); all_files_encoding_ok(qw(t/_INEXISTENT_), sort(glob(q(t/bad/*)))); test_test( title => "couldn't test all_files_encoding_ok(t/bad)", skip_err=> 1, ); } Test-Mojibake-1.3/t/PaxHeader/01-self-check.t000644 777777 777777 00000000212 13046111753 024165 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838589 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/01-self-check.t000644 €)®ô˜€)—Ue00000000132 13046111753 023226 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use strict; use warnings qw(all); use Test::Mojibake; all_files_encoding_ok(); Test-Mojibake-1.3/t/PaxHeader/01-test-check.t000644 777777 777777 00000000212 13046111753 024213 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838590 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/01-test-check.t000644 €)®ô˜€)—Ue00000000144 13046111753 023257 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use strict; use warnings qw(all); use Test::Mojibake; all_files_encoding_ok(qw(t/good)); Test-Mojibake-1.3/t/PaxHeader/02-bad-source.t000644 777777 777777 00000000212 13046111753 024206 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838591 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/02-bad-source.t000644 €)®ô˜€)—Ue00000001623 13046111753 023255 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use strict; use warnings qw(all); use Test::Builder::Tester tests => 4; use Test::More; BEGIN { use_ok('Test::Mojibake'); } BAD: { my ($name, $file); $name = 'Latin-1 with "use utf8"!'; $file = 't/bad/bad-latin1.pl_'; test_out("not ok 1 - $name"); file_encoding_ok($file, $name); test_fail(-1); test_diag("Non-UTF-8 unexpected in $file, line 6 (source)"); test_test("$name is bad"); $name = 'UTF-8 with no "use utf8"!'; $file = 't/bad/bad-utf8.pl_'; test_out("not ok 1 - $name"); file_encoding_ok($file, $name); test_fail(-1); test_diag("UTF-8 unexpected in $file, line 5 (source)"); test_test("$name is bad"); $name = 'no source at all'; $file = 't/bad/dummy.pl_'; test_out("not ok 1 - $name"); file_encoding_ok($file, $name); test_fail(-1); test_diag("$file does not exist"); test_test("$name is bad"); } Test-Mojibake-1.3/t/PaxHeader/02-good-source.t000644 777777 777777 00000000212 13046111753 024410 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838594 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/02-good-source.t000644 €)®ô˜€)—Ue00000000375 13046111753 023462 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use strict; use warnings qw(all); use Test::More tests => 5; BEGIN { use_ok('Test::Mojibake'); } for (qw(ascii.pl latin1.pl utf8.pl_ mojibake.pl_)) { my $file = 't/good/' . $_; file_encoding_ok($file, "$file encoding is OK"); } Test-Mojibake-1.3/t/PaxHeader/03-bad-pod.t000644 777777 777777 00000000212 13046111753 023471 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838575 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/03-bad-pod.t000644 €)®ô˜€)—Ue00000001710 13046111753 022535 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use strict; use warnings qw(all); use Test::Builder::Tester tests => 4; use Test::More; BEGIN { use_ok('Test::Mojibake'); } BAD: { my ($name, $file); $name = 'Latin-1 with "=encoding utf8"!'; $file = 't/bad/bad-latin1.pod_'; test_out("not ok 1 - $name"); file_encoding_ok($file, $name); test_fail(-1); test_diag("UTF-8 unexpected in $file, line 5 (POD)"); test_test("$name is bad"); $name = 'UTF-8 with no "=encoding utf8"!'; $file = 't/bad/bad-utf8.pod_'; test_out("not ok 1 - $name"); file_encoding_ok($file, $name); test_fail(-1); test_diag("Non-UTF-8 unexpected in $file, line 7 (POD)"); test_test("$name is bad"); $name = 'Multiple "=encoding"!'; $file = 't/bad/mojibake.pod_'; test_out("not ok 1 - $name"); file_encoding_ok($file, $name); test_fail(-1); test_diag("POD =encoding redeclared in t/bad/mojibake.pod_, line 13"); test_test("$name is bad"); } Test-Mojibake-1.3/t/PaxHeader/03-good-pod.t000644 777777 777777 00000000212 13046111753 023673 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838579 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/03-good-pod.t000644 €)®ô˜€)—Ue00000000357 13046111753 022745 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use strict; use warnings qw(all); use Test::More tests => 4; BEGIN { use_ok('Test::Mojibake'); } for (qw(ascii latin1 utf8)) { my $file = 't/good/' . $_ . '.pod'; file_encoding_ok($file, "$file encoding is OK"); } Test-Mojibake-1.3/t/PaxHeader/04-bom.t000644 777777 777777 00000000212 13046111753 022741 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838565 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/04-bom.t000644 €)®ô˜€)—Ue00000000635 13046111753 022012 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use strict; use warnings qw(all); use Test::Builder::Tester tests => 2; use Test::More; BEGIN { use_ok('Test::Mojibake'); } BAD: { my $name = 'Byte Order Mark is unnecessary!'; my $file = 't/bad/bom.pl_'; test_out("not ok 1 - $name"); file_encoding_ok($file, $name); test_fail(-1); test_diag("UTF-8 BOM (Byte Order Mark) found in $file"); test_test("$name is bad"); } Test-Mojibake-1.3/t/PaxHeader/05-encode.t000644 777777 777777 00000000212 13046111753 023422 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838570 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/05-encode.t000644 €)®ô˜€)—Ue00000000205 13046111753 022464 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use strict; use warnings qw(all); use Encode; use Test::Mojibake; all_files_encoding_ok(all_files(), $INC{'Encode.pm'}); Test-Mojibake-1.3/t/PaxHeader/06-pp-vs-xs.t000644 777777 777777 00000000212 13046111753 023663 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838580 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/06-pp-vs-xs.t000644 €)®ô˜€)—Ue00000002016 13046111753 022727 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use strict; use warnings qw(all); use Test::More; ## no critic (ProhibitPackageVars, ProtectPrivateSubs) BEGIN { use_ok('Benchmark', 'countit'); use_ok('Test::Mojibake'); } unless ($Test::Mojibake::use_xs) { diag('No XS module detected, will fallback to PP implementation!'); done_testing(2); exit; } our @buf; our $err = 0; for (qw(latin1.pl ascii.pod utf8.pl_)) { # _detect_utf8() to return qw(0 1 2) local $/ = undef; ok(open(my $fh, '<:raw', 't/good/' . $_), "opening $_ test"); push @buf, <$fh>; close $fh; } my $time = 1.0; my $t0 = countit($time, '&run()'); $Test::Mojibake::use_xs = 0; my $t1 = countit($time, '&run()'); ok($err == 0, 'correct encoding matches'); ok($t0->iters > $t1->iters, 'XS faster than PP'); diag(sprintf('XS/PP speed ratio is %0.2f', $t0->iters / $t1->iters)); done_testing(7); sub run { my $i = 0; for (@buf) { my $j = Test::Mojibake::_detect_utf8(\$_); ++$err if $i != $j; } continue { ++$i; } return; } Test-Mojibake-1.3/t/PaxHeader/07-broken-utf8.t000644 777777 777777 00000000212 13046111753 024333 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838595 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/07-broken-utf8.t000644 €)®ô˜€)—Ue00000002013 13046111753 023374 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use strict; use warnings qw(all); use Test::More; use Test::Mojibake; ## no critic (ProhibitPackageVars, ProtectPrivateSubs) $Test::Mojibake::use_xs = 0; # borrowed from BRADFITZ/Unicode-CheckUTF8-1.03/t/01-all.t my @tests = ( ["0-unknown" => 0 => \"\x80"], ["0-bad" => 0 => \"\xc0\xc1"], ["1-simple" => 1 => \"a"], ["2-simple" => 1 => \"Some string!"], ["3-german" => 2 => \"Stra\xc3\x9fe"], ["4-german-cut" => 0 => \"Stra\xc3"], ["5-null" => 0 => \"\0"], ["5-null2" => 0 => \"this has a \0 null"], ["6-outrange" => 0 => \"\xff"], ["7-overlong-1" => 0 => \"\xc0\xaf"], ["8-overlong-2" => 0 => \"\xe0\x80\xaf"], ["9-overlong-3" => 0 => \"\xf0\x80\x80\xaf"], ["10-overlong-4" => 0 => \"\xf8\x80\x80\x80\xaf"], ["11-overlong-5" => 0 => \"\xfc\x80\x80\x80\x80\xaf"], ); ok(Test::Mojibake::_detect_utf8($_->[2]) == $_->[1], $_->[0]) for @tests; done_testing(scalar @tests); Test-Mojibake-1.3/t/PaxHeader/08-all-files-none-found.t000644 777777 777777 00000000212 13046111753 026106 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838620 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/08-all-files-none-found.t000644 €)®ô˜€)—Ue00000000752 13046111753 025157 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use strict; use warnings qw(all); use Test::Builder::Tester tests => 1; use Test::More; use Test::Mojibake; ALL_FILES_NONE_FOUND: { ## no critic (ProhibitNoWarnings) no warnings qw(redefine); my @plan; *Test::Builder::plan = sub { shift; @plan = @_ }; all_files_encoding_ok(qw(t/_INEXISTENT_)); is_deeply( \@plan, [ skip_all => 'could not find any files to test' ], 'tests are skipped when there are no files to test' ); } Test-Mojibake-1.3/t/PaxHeader/author-critic.t000644 777777 777777 00000000212 13046111753 024520 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838593 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/author-critic.t000644 €)®ô˜€)—Ue00000000637 13046111753 023573 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } use strict; use warnings; use Test::More; use English qw(-no_match_vars); eval "use Test::Perl::Critic"; plan skip_all => 'Test::Perl::Critic required to criticise code' if $@; Test::Perl::Critic->import( -profile => "perlcritic.rc" ) if -e "perlcritic.rc"; all_critic_ok(); Test-Mojibake-1.3/t/PaxHeader/author-eol.t000644 777777 777777 00000000212 13046111753 024022 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838578 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/author-eol.t000644 €)®ô˜€)—Ue00000003142 13046111753 023067 0ustar00spoussepCORPAD\Domain Users000000 000000 BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } use 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 = ( 'bin/scan_mojibake', 'lib/Test/Mojibake.pm', 't/00-compile.t', 't/00-load.t', 't/01-bad-check.t', 't/01-self-check.t', 't/01-test-check.t', 't/02-bad-source.t', 't/02-good-source.t', 't/03-bad-pod.t', 't/03-good-pod.t', 't/04-bom.t', 't/05-encode.t', 't/06-pp-vs-xs.t', 't/07-broken-utf8.t', 't/08-all-files-none-found.t', 't/author-critic.t', 't/author-eol.t', 't/author-mojibake.t', 't/author-no-tabs.t', 't/author-pod-coverage.t', 't/author-pod-linkcheck.t', 't/author-pod-syntax.t', 't/author-portability.t', 't/author-synopsis.t', 't/author-test-version.t', 't/bad/bad-latin1.pl_', 't/bad/bad-latin1.pod_', 't/bad/bad-utf8.pl_', 't/bad/bad-utf8.pod_', 't/bad/bom.pl_', 't/bad/mojibake.pod_', 't/good/Makefile.PL', 't/good/README', 't/good/ascii.pl', 't/good/ascii.pod', 't/good/latin1.pl', 't/good/latin1.pod', 't/good/mojibake.pl_', 't/good/shebang', 't/good/utf8.pl_', 't/good/utf8.pod', 't/release-cpan-changes.t', 't/release-dist-manifest.t', 't/release-distmeta.t', 't/release-kwalitee.t', 't/release-meta-json.t', 't/release-minimum-version.t', 't/release-unused-vars.t' ); eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; done_testing; Test-Mojibake-1.3/t/PaxHeader/author-mojibake.t000644 777777 777777 00000000212 13046111753 025024 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838602 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/author-mojibake.t000644 €)®ô˜€)—Ue00000000353 13046111753 024072 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } use strict; use warnings qw(all); use Test::More; use Test::Mojibake; all_files_encoding_ok(); Test-Mojibake-1.3/t/PaxHeader/author-no-tabs.t000644 777777 777777 00000000212 13046111753 024606 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838598 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/author-no-tabs.t000644 €)®ô˜€)—Ue00000003110 13046111753 023646 0ustar00spoussepCORPAD\Domain Users000000 000000 BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } use 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 = ( 'bin/scan_mojibake', 'lib/Test/Mojibake.pm', 't/00-compile.t', 't/00-load.t', 't/01-bad-check.t', 't/01-self-check.t', 't/01-test-check.t', 't/02-bad-source.t', 't/02-good-source.t', 't/03-bad-pod.t', 't/03-good-pod.t', 't/04-bom.t', 't/05-encode.t', 't/06-pp-vs-xs.t', 't/07-broken-utf8.t', 't/08-all-files-none-found.t', 't/author-critic.t', 't/author-eol.t', 't/author-mojibake.t', 't/author-no-tabs.t', 't/author-pod-coverage.t', 't/author-pod-linkcheck.t', 't/author-pod-syntax.t', 't/author-portability.t', 't/author-synopsis.t', 't/author-test-version.t', 't/bad/bad-latin1.pl_', 't/bad/bad-latin1.pod_', 't/bad/bad-utf8.pl_', 't/bad/bad-utf8.pod_', 't/bad/bom.pl_', 't/bad/mojibake.pod_', 't/good/Makefile.PL', 't/good/README', 't/good/ascii.pl', 't/good/ascii.pod', 't/good/latin1.pl', 't/good/latin1.pod', 't/good/mojibake.pl_', 't/good/shebang', 't/good/utf8.pl_', 't/good/utf8.pod', 't/release-cpan-changes.t', 't/release-dist-manifest.t', 't/release-distmeta.t', 't/release-kwalitee.t', 't/release-meta-json.t', 't/release-minimum-version.t', 't/release-unused-vars.t' ); notabs_ok($_) foreach @files; done_testing; Test-Mojibake-1.3/t/PaxHeader/author-pod-coverage.t000644 777777 777777 00000000212 13046111753 025616 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838614 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/author-pod-coverage.t000644 €)®ô˜€)—Ue00000000536 13046111753 024667 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. use Test::Pod::Coverage 1.08; use Pod::Coverage::TrustPod; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); Test-Mojibake-1.3/t/PaxHeader/author-pod-linkcheck.t000644 777777 777777 00000000212 13046111753 025756 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838618 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/author-pod-linkcheck.t000644 €)®ô˜€)—Ue00000000741 13046111753 025025 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } use strict; use warnings; use Test::More; foreach my $env_skip ( qw( SKIP_POD_LINKCHECK ) ){ plan skip_all => "\$ENV{$env_skip} is set, skipping" if $ENV{$env_skip}; } eval "use Test::Pod::LinkCheck"; if ( $@ ) { plan skip_all => 'Test::Pod::LinkCheck required for testing POD'; } else { Test::Pod::LinkCheck->new->all_pod_ok; } Test-Mojibake-1.3/t/PaxHeader/author-pod-syntax.t000644 777777 777777 00000000212 13046111753 025351 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838611 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/author-pod-syntax.t000644 €)®ô˜€)—Ue00000000454 13046111753 024421 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); Test-Mojibake-1.3/t/PaxHeader/author-portability.t000644 777777 777777 00000000212 13046111753 025605 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838613 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/author-portability.t000644 €)®ô˜€)—Ue00000000471 13046111753 024654 0ustar00spoussepCORPAD\Domain Users000000 000000 BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } 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(); Test-Mojibake-1.3/t/PaxHeader/author-synopsis.t000644 777777 777777 00000000212 13046111753 025132 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838603 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/author-synopsis.t000644 €)®ô˜€)—Ue00000000262 13046111753 024177 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } use Test::Synopsis; all_synopsis_ok(); Test-Mojibake-1.3/t/PaxHeader/author-test-version.t000644 777777 777777 00000000212 13046111753 025705 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838616 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/author-test-version.t000644 €)®ô˜€)—Ue00000001041 13046111753 024746 0ustar00spoussepCORPAD\Domain Users000000 000000 BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } use 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; Test-Mojibake-1.3/t/PaxHeader/bad000755 777777 777777 00000000212 13046111753 022232 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838571 18 SCHILY.nlink=8 Test-Mojibake-1.3/t/bad/000755 €)®ô˜€)—Ue00000000000 13046111753 021351 5ustar00spoussepCORPAD\Domain Users000000 000000 Test-Mojibake-1.3/t/PaxHeader/good000755 777777 777777 00000000213 13046111753 022435 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838573 19 SCHILY.nlink=12 Test-Mojibake-1.3/t/good/000755 €)®ô˜€)—Ue00000000000 13046111753 021553 5ustar00spoussepCORPAD\Domain Users000000 000000 Test-Mojibake-1.3/t/PaxHeader/release-cpan-changes.t000644 777777 777777 00000000212 13046111753 025710 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838617 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/release-cpan-changes.t000644 €)®ô˜€)—Ue00000000553 13046111753 024760 0ustar00spoussepCORPAD\Domain Users000000 000000 BEGIN { unless ($ENV{RELEASE_TESTING}) { print qq{1..0 # SKIP these tests are for release candidate testing\n}; exit } } use 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'); }; Test-Mojibake-1.3/t/PaxHeader/release-dist-manifest.t000644 777777 777777 00000000212 13046111753 026130 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838619 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/release-dist-manifest.t000644 €)®ô˜€)—Ue00000000437 13046111753 025201 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { print qq{1..0 # SKIP these tests are for release candidate testing\n}; exit } } use Test::More; eval "use Test::DistManifest"; plan skip_all => "Test::DistManifest required for testing the manifest" if $@; manifest_ok(); Test-Mojibake-1.3/t/PaxHeader/release-distmeta.t000644 777777 777777 00000000212 13046111753 025173 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838608 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/release-distmeta.t000644 €)®ô˜€)—Ue00000000401 13046111753 024233 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { print qq{1..0 # SKIP these tests are for release candidate testing\n}; exit } } # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. use Test::CPAN::Meta; meta_yaml_ok(); Test-Mojibake-1.3/t/PaxHeader/release-kwalitee.t000644 777777 777777 00000000212 13046111753 025166 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838609 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/release-kwalitee.t000644 €)®ô˜€)—Ue00000000504 13046111753 024232 0ustar00spoussepCORPAD\Domain Users000000 000000 BEGIN { unless ($ENV{RELEASE_TESTING}) { print qq{1..0 # SKIP these tests are for release candidate testing\n}; exit } } # 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; Test-Mojibake-1.3/t/PaxHeader/release-meta-json.t000644 777777 777777 00000000212 13046111753 025256 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838612 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/release-meta-json.t000644 €)®ô˜€)—Ue00000000273 13046111753 024325 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { print qq{1..0 # SKIP these tests are for release candidate testing\n}; exit } } use Test::CPAN::Meta::JSON; meta_json_ok(); Test-Mojibake-1.3/t/PaxHeader/release-minimum-version.t000644 777777 777777 00000000212 13046111753 026517 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838621 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/release-minimum-version.t000644 €)®ô˜€)—Ue00000000477 13046111753 025574 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { print qq{1..0 # SKIP these tests are for release candidate testing\n}; exit } } use Test::More; eval "use Test::MinimumVersion"; plan skip_all => "Test::MinimumVersion required for testing minimum versions" if $@; all_minimum_version_from_metayml_ok(); Test-Mojibake-1.3/t/PaxHeader/release-unused-vars.t000644 777777 777777 00000000212 13046111753 025635 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838615 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/release-unused-vars.t000644 €)®ô˜€)—Ue00000000571 13046111753 024705 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { print qq{1..0 # SKIP these tests are for release candidate testing\n}; exit } } use Test::More 0.96 tests => 1; eval { require Test::Vars }; SKIP: { skip 1 => 'Test::Vars required for testing for unused vars' if $@; Test::Vars->import; subtest 'unused vars' => sub { all_vars_ok(); }; }; Test-Mojibake-1.3/t/good/PaxHeader/ascii.pl000755 777777 777777 00000000212 13046111753 024136 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838581 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/good/ascii.pl000755 €)®ô˜€)—Ue00000000377 13046111753 023212 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use open ':locale'; use strict; use warnings; # here is a comment containing ütf8 cháraçtërs, but we ignore these print "A noite, vovo Kowalsky ve o ima cair no pe do pinguim queixoso e vovo poe acucar no cha de tamaras do jabuti feliz.\n"; Test-Mojibake-1.3/t/good/PaxHeader/ascii.pod000644 777777 777777 00000000212 13046111753 024302 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838585 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/good/ascii.pod000644 €)®ô˜€)—Ue00000000216 13046111753 023346 0ustar00spoussepCORPAD\Domain Users000000 000000 =pod =head1 ASCII A noite, vovo Kowalsky ve o ima cair no pe do pinguim queixoso e vovo poe acucar no cha de tamaras do jabuti feliz. =cut Test-Mojibake-1.3/t/good/PaxHeader/latin1.pl000755 777777 777777 00000000212 13046111753 024236 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838586 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/good/latin1.pl000755 €)®ô˜€)—Ue00000000350 13046111753 023301 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use open ':locale'; use strict; use warnings; # here is a comment containing látïñ1 characters print "À noite, vovô Kowalsky vê o ímã cair no pé do pingüim queixoso e vovó põe açúcar no chá de tâmaras do jabuti feliz.\n"; Test-Mojibake-1.3/t/good/PaxHeader/latin1.pod000644 777777 777777 00000000212 13046111753 024402 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838592 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/good/latin1.pod000644 €)®ô˜€)—Ue00000000246 13046111753 023451 0ustar00spoussepCORPAD\Domain Users000000 000000 =pod =encoding iso-8859-1 =head1 LATIN-1 À noite, vovô Kowalsky vê o ímã cair no pé do pingüim queixoso e vovó põe açúcar no chá de tâmaras do jabuti feliz. =cut Test-Mojibake-1.3/t/good/PaxHeader/Makefile.PL000644 777777 777777 00000000212 13046111753 024460 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838597 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/good/Makefile.PL000644 €)®ô˜€)—Ue00000002420 13046111753 023523 0ustar00spoussepCORPAD\Domain Users000000 000000 use strict; use warnings; use 5.006; use ExtUtils::MakeMaker 6.30; my %WriteMakefileArgs = ( "ABSTRACT" => "check your source for encoding misbehavior.", "AUTHOR" => "Stanislaw Pusep ", "BUILD_REQUIRES" => { "Encode" => 0, "File::Find" => 0, "File::Temp" => 0, "Test::Builder::Tester" => 0, "Test::More" => 0 }, "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.30" }, "DISTNAME" => "Test-Mojibake", "EXE_FILES" => [ "bin/scan_mojibake" ], "LICENSE" => "perl", "NAME" => "Test::Mojibake", "PREREQ_PM" => { "File::Spec::Functions" => 0, "Pod::Usage" => 0, "Test::Builder" => 0, "bytes" => 0, "integer" => 0, "strict" => 0, "warnings" => 0 }, "VERSION" => "0.8", "test" => { "TESTS" => "t/*.t" } ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; my $pp = $WriteMakefileArgs{PREREQ_PM}; for my $mod ( keys %$br ) { if ( exists $pp->{$mod} ) { $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; } else { $pp->{$mod} = $br->{$mod}; } } } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); Test-Mojibake-1.3/t/good/PaxHeader/mojibake.pl_000755 777777 777777 00000000212 13046111753 024766 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838601 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/good/mojibake.pl_000755 €)®ô˜€)—Ue00000000530 13046111753 024031 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use open ':locale'; use strict; use warnings; use utf8; print "À noite, vovô Kowalsky vê o ímã cair no pé do pingüim queixoso e vovó põe açúcar no chá de tâmaras do jabuti feliz.\n"; no utf8; print "À noite, vovô Kowalsky vê o ímã cair no pé do pingüim queixoso e vovó põe açúcar no chá de tâmaras do jabuti feliz.\n"; Test-Mojibake-1.3/t/good/PaxHeader/README000644 777777 777777 00000000212 13046111753 023366 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838574 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/good/README000644 €)®ô˜€)—Ue00000000021 13046111753 022424 0ustar00spoussepCORPAD\Domain Users000000 000000 Thou Shall Pass! Test-Mojibake-1.3/t/good/PaxHeader/shebang000755 777777 777777 00000000212 13046111753 024043 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838576 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/good/shebang000755 €)®ô˜€)—Ue00000000046 13046111753 023110 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use common::sense; say $^V; Test-Mojibake-1.3/t/good/PaxHeader/utf8.pl_000755 777777 777777 00000000212 13046111753 024073 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838582 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/good/utf8.pl_000755 €)®ô˜€)—Ue00000000357 13046111753 023145 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use strict; use utf8::all; use warnings; # here is a comment containing ütf8 characters print "À noite, vovô Kowalsky vê o ímã cair no pé do pingüim queixoso e vovó põe açúcar no chá de tâmaras do jabuti feliz.\n"; Test-Mojibake-1.3/t/good/PaxHeader/utf8.pod000644 777777 777777 00000000212 13046111753 024100 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838583 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/good/utf8.pod000644 €)®ô˜€)—Ue00000000254 13046111753 023146 0ustar00spoussepCORPAD\Domain Users000000 000000 =pod =encoding UTF-8 =head1 UTF-8 À noite, vovô Kowalsky vê o ímã cair no pé do pingüim queixoso e vovó põe açúcar no chá de tâmaras do jabuti feliz. =cut Test-Mojibake-1.3/t/bad/PaxHeader/bad-latin1.pl_000755 777777 777777 00000000212 13046111753 024717 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838607 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/bad/bad-latin1.pl_000755 €)®ô˜€)—Ue00000000301 13046111753 023756 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use open ':locale'; use strict; use utf8; use warnings; print "À noite, vovô Kowalsky vê o ímã cair no pé do pingüim queixoso e vovó põe açúcar no chá de tâmaras do jabuti feliz.\n"; Test-Mojibake-1.3/t/bad/PaxHeader/bad-latin1.pod_000644 777777 777777 00000000212 13046111753 025063 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838610 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/bad/bad-latin1.pod_000644 €)®ô˜€)—Ue00000000233 13046111753 024126 0ustar00spoussepCORPAD\Domain Users000000 000000 =pod =head1 UTF-8 À noite, vovô Kowalsky vê o ímã cair no pé do pingüim queixoso e vovó põe açúcar no chá de tâmaras do jabuti feliz. =cut Test-Mojibake-1.3/t/bad/PaxHeader/bad-utf8.pl_000755 777777 777777 00000000212 13046111753 024415 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838596 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/bad/bad-utf8.pl_000755 €)®ô˜€)—Ue00000000304 13046111753 023457 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use open ':locale'; use strict; use warnings; print "À noite, vovô Kowalsky vê o ímã cair no pé do pingüim queixoso e vovó põe açúcar no chá de tâmaras do jabuti feliz.\n"; Test-Mojibake-1.3/t/bad/PaxHeader/bad-utf8.pod_000644 777777 777777 00000000212 13046111753 024561 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838599 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/bad/bad-utf8.pod_000644 €)®ô˜€)—Ue00000000240 13046111753 023622 0ustar00spoussepCORPAD\Domain Users000000 000000 =pod =encoding utf8 =head1 LATIN-1 À noite, vovô Kowalsky vê o ímã cair no pé do pingüim queixoso e vovó põe açúcar no chá de tâmaras do jabuti feliz. =cut Test-Mojibake-1.3/t/bad/PaxHeader/bom.pl_000755 777777 777777 00000000212 13046111753 023560 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838572 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/bad/bom.pl_000755 €)®ô˜€)—Ue00000000267 13046111753 022632 0ustar00spoussepCORPAD\Domain Users000000 000000 #!perl -T use open ':locale'; use utf8; print "À noite, vovô Kowalsky vê o ímã cair no pé do pingüim queixoso e vovó põe açúcar no chá de tâmaras do jabuti feliz.\n"; Test-Mojibake-1.3/t/bad/PaxHeader/mojibake.pod_000644 777777 777777 00000000212 13046111753 024730 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838600 18 SCHILY.nlink=1 Test-Mojibake-1.3/t/bad/mojibake.pod_000644 €)®ô˜€)—Ue00000000710 13046111753 023773 0ustar00spoussepCORPAD\Domain Users000000 000000 =pod =encoding ISO8851-1 =head1 ASCII A noite, vovo Kowalsky ve o ima cair no pe do pinguim queixoso e vovo poe acucar no cha de tamaras do jabuti feliz. =head1 LATIN-1 À noite, vovô Kowalsky vê o ímã cair no pé do pingüim queixoso e vovó põe açúcar no chá de tâmaras do jabuti feliz. =encoding utf8 =head1 UTF-8 À noite, vovô Kowalsky vê o ímã cair no pé do pingüim queixoso e vovó põe açúcar no chá de tâmaras do jabuti feliz. =cut Test-Mojibake-1.3/lib/PaxHeader/Test000755 777777 777777 00000000212 13046111753 022726 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838605 18 SCHILY.nlink=3 Test-Mojibake-1.3/lib/Test/000755 €)®ô˜€)—Ue00000000000 13046111753 022045 5ustar00spoussepCORPAD\Domain Users000000 000000 Test-Mojibake-1.3/lib/Test/PaxHeader/Mojibake.pm000644 777777 777777 00000000212 13046111753 025057 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838606 18 SCHILY.nlink=1 Test-Mojibake-1.3/lib/Test/Mojibake.pm000644 €)®ô˜€)—Ue00000036015 13046111753 024131 0ustar00spoussepCORPAD\Domain Users000000 000000 package Test::Mojibake; # ABSTRACT: check your source for encoding misbehavior. use strict; use warnings qw(all); our $VERSION = '1.3'; # VERSION use File::Spec::Functions; use Test::Builder; my %ignore_dirs = ( '.bzr' => 'Bazaar', '.git' => 'Git', '.hg' => 'Mercurial', '.pc' => 'quilt', '.svn' => 'Subversion', CVS => 'CVS', RCS => 'RCS', SCCS => 'SCCS', _darcs => 'darcs', _sgbak => 'Vault/Fortress', ); my $Test = Test::Builder->new; # Use a faster/safer XS alternative, if present ## no critic (ProhibitStringyEval, RequireCheckingReturnValueOfEval, ProhibitPackageVars) our ($use_xs, $use_pp) = (0, 0); if ( eval 'require Unicode::CheckUTF8' ) { $use_xs = 1; } elsif ( eval 'require Unicode::CheckUTF8::PP' ) { $use_pp = 1; } sub import { my ($self, @args) = @_; my $caller = caller; for my $func (qw(file_encoding_ok all_files all_files_encoding_ok)) { ## no critic (ProhibitNoStrict) no strict 'refs'; *{$caller."::".$func} = \&$func; } $Test->exported_to($caller); $Test->plan(@args); return; } ## no critic (ProhibitCascadingIfElse, ProhibitExcessComplexity) sub file_encoding_ok { my ($file, $name) = @_; $name = defined($name) ? $name : "Mojibake test for $file"; ## no critic (ProhibitFiletest_f) unless (-f $file) { $Test->ok(0, $name); $Test->diag("$file does not exist"); return; } my $fh; unless (open($fh, '<:raw', $file)) { close $fh; $Test->ok(0, $name); $Test->diag("Can't open $file: $!"); return; } my $use_utf8 = 0; my $pod = 0; my $pod_utf8 = 0; my $n = 1; my %pod = (); while (my $line = <$fh>) { if (($n == 1) && $line =~ /^\x{EF}\x{BB}\x{BF}/x) { $Test->ok(0, $name); $Test->diag("UTF-8 BOM (Byte Order Mark) found in $file"); return; } elsif ($line =~ /^=+cut\s*$/x) { $pod = 0; } elsif ($line =~ /^=+encoding\s+([\w\-]+)/x) { my $pod_encoding = lc $1; $pod_encoding =~ y/-//d; # perlpod states: # =encoding affects the whole document, and must occur only once. ++$pod{$pod_encoding}; if (1 < scalar keys %pod) { $Test->ok(0, $name); $Test->diag("POD =encoding redeclared in $file, line $n"); return; } $pod_utf8 = ($pod_encoding eq 'utf8') ? 1 : 0; $pod = 1; } elsif ($line =~ /^=+\w+/x) { $pod = 1; } elsif ($pod == 0) { # source $line =~ s/^\s*\#.*$//sx; # disclaimers placed in headers frequently contain UTF-8 *before* its usage is declared. foreach (split m{;}x, $line) { # trim s/^\s+|\s+$//gsx; my @type = qw(0 0 0); ++$type[_detect_utf8(\$_)]; my ($latin1, $utf8) = @type[0, 2]; if (/^use\s+utf8(?:::all)?$/x) { $use_utf8 = 1; } elsif (/^use\s+common::sense$/x) { $use_utf8 = 1; } elsif (/^no\s+utf8$/x) { $use_utf8 = 0; } if (($use_utf8 == 0) && $utf8) { $Test->ok(0, $name); $Test->diag("UTF-8 unexpected in $file, line $n (source)"); return; } elsif (($use_utf8 == 1) && $latin1) { $Test->ok(0, $name); $Test->diag("Non-UTF-8 unexpected in $file, line $n (source)"); return; } } } else { # POD my @type = qw(0 0 0); ++$type[_detect_utf8(\$line)]; my ($latin1, $utf8) = @type[0, 2]; if (($pod_utf8 == 0) && $utf8) { $Test->ok(0, $name); $Test->diag("UTF-8 unexpected in $file, line $n (POD)"); return; } elsif (($pod_utf8 == 1) && $latin1) { $Test->ok(0, $name); $Test->diag("Non-UTF-8 unexpected in $file, line $n (POD)"); return; } } } continue { ++$n; } close $fh; $Test->ok(1, $name); return 1; } sub all_files_encoding_ok { my (@args) = @_; @args = _starting_points() unless @args; ## no critic (ProhibitFiletest_f) my @files = map { -d $_ ? all_files($_) : (-f $_ ? $_ : ()) } @args; unless (@files) { $Test->plan(skip_all => 'could not find any files to test'); return; } $Test->plan(tests => scalar @files); my $ok = 1; foreach my $file (@files) { file_encoding_ok($file) or undef $ok; } return $ok; } sub all_files { my (@queue) = @_; @queue = _starting_points() unless @queue; my @mod = (); while (@queue) { my $file = shift @queue; if (-d $file) { opendir my $dh, $file or next; my @newfiles = readdir $dh; closedir $dh; @newfiles = no_upwards(@newfiles); @newfiles = grep { not exists $ignore_dirs{$_} } @newfiles; foreach my $newfile (@newfiles) { my $filename = catfile($file, $newfile); unless (-d $filename) { push @queue, $filename; } else { push @queue, catdir($file, $newfile); } } } ## no critic (ProhibitFiletest_f) if (-f $file) { push @mod, $file if _is_perl($file); } } return @mod; } sub _starting_points { return 'blib' if -e 'blib'; return 'lib'; } sub _is_perl { my $file = shift; return 1 if $file =~ /\.PL$/x; return 1 if $file =~ /\.p(?:l|m|od)$/x; return 1 if $file =~ /\.t$/x; open my $fh, '<', $file or return; my $first = <$fh>; close $fh; return 1 if defined $first && ($first =~ /(?:^\#!.*perl)|--\*-Perl-\*--/x); return; } sub _detect_utf8 { use bytes; use integer; my $str = shift; if ($use_xs) { if (Unicode::CheckUTF8::is_utf8(${$str})) { return (${$str} =~ m{[\x{80}-\x{ff}]}x) ? 2 : 1 } else { return 0; } } elsif ($use_pp) { if (Unicode::CheckUTF8::PP::is_utf8(${$str})) { return (${$str} =~ m{[\x{80}-\x{ff}]}x) ? 2 : 1 } else { return 0; } } my $d = 0; my $c = 0; my $bv = 0; my $bits = 0; my $len = length ${$str}; for (my $i = 0; $i < $len; $i++) { $c = ord(substr(${$str}, $i, 1)); if ($c >= 128) { $d++; if ($c >= 254) { return 0; } elsif ($c >= 252) { $bits = 6; } elsif ($c >= 248) { $bits = 5; } elsif ($c >= 240) { $bits = 4; } elsif ($c >= 224) { $bits = 3; } elsif ($c >= 192) { $bits = 2; } else { return 0; } if (($i + $bits) > $len) { return 0; } my @buf = ((0) x 4, $c & ((1 << (7 - $bits)) - 1)); while ($bits > 1) { $i++; $bv = ord(substr(${$str}, $i, 1)); if (($bv < 128) || ($bv > 191)) { return 0; } $buf[7 - $bits] = $bv & 0x3f; $bits--; } return 0 if "\0\0\0\0\0\x2f" eq pack 'c6', @buf; } elsif ($c == 0) { return 0; } } return $d ? 2 : 1; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Test::Mojibake - check your source for encoding misbehavior. =head1 VERSION version 1.3 =head1 SYNOPSIS # Test::Mojibake lets you check for inconsistencies in source/documentation encoding, and report its results in standard Test::Simple fashion. no strict 'vars'; use Test::Mojibake; file_encoding_ok($file, 'Valid encoding'); done_testing($num_tests); =head1 DESCRIPTION Many modern text editors automatically save files using UTF-8 codification, however, L interpreter does not expects it I. Whereas this does not represent a big deal on (most) backend-oriented programs, Web framework (L, L) based applications will suffer of so-called L (lit. "unintelligible sequence of characters"). Even worse: if an editor saves BOM (Byte Order Mark, C character in Unicode) at the start of the script with executable bit set (on Unix systems), it won't execute at all, due to shebang corruption. Avoiding codification problems is quite simple: =over 4 =item * Always C/C when saving source as UTF-8; =item * Always specify C<=encoding UTF-8> when saving POD as UTF-8; =item * Do neither of above when saving as ISO-8859-1; =item * B save BOM (not that it's wrong; just avoid it as you'll barely notice it's presence when in trouble). =back However, if you find yourself upgrading old code to use UTF-8 or trying to standardize a big project with many developers each one using a different platform/editor, reviewing all files manually can be quite painful. Specially in cases when some files have multiple encodings (note: it all started when I realized that I & derivatives are unable to open files with character conversion tables). Enter the L C<;)> =head1 FUNCTIONS =head2 file_encoding_ok( FILENAME[, TESTNAME ] ) Validates the codification of C. When it fails, C will report the probable cause. The optional second argument C is the name of the test. If it is omitted, C chooses a default test name "Mojibake test for FILENAME". =head2 all_files_encoding_ok( [@entries] ) Validates codification of all the files under C<@entries>. It runs C on directories and assumes everything else to be a file to be tested. It calls the C function for you (one test for each file), so you can't have already called C. If C<@entries> is empty or not passed, the function finds all source/documentation files in files in the F directory if it exists, or the F directory if not. A source/documentation file is one that ends with F<.pod>, F<.pl> and F<.pm>, or any file where the first line looks like a shebang line. =head2 all_files( [@dirs] ) Returns a list of all the Perl files in I<@dirs> and in directories below. If no directories are passed, it defaults to F if F exists, or else F if not. Skips any files in CVS, .svn, .git and similar directories. See C<%Test::Mojibake::ignore_dirs> for a list of them. A Perl file is: =over 4 =item * Any file that ends in F<.PL>, F<.pl>, F<.pm>, F<.pod>, or F<.t>; =item * Any file that has a first line with a shebang and C<"perl"> on it; =item * Any file that ends in F<.bat> and has a first line with C<"--*-Perl-*--"> on it. =back The order of the files returned is machine-dependent. If you want them sorted, you'll have to sort them yourself. =head2 _detect_utf8( \$string ) Detects presence of UTF-8 encoded characters in a referenced octet stream. Return codes: =over 4 =item * 0 - 8-bit characters detected, does not validate as UTF-8; =item * 1 - only 7-bit characters; =item * 2 - 8-bit characters detected, validates as UTF-8. =back L is highly recommended, however, it is optional and this function will fallback to the Pure Perl implementation of the following PHP code: L =head1 SAMPLE TEST SCRIPT Module authors can include the following in a F file and have L automatically find and check all source files in a module distribution: #!perl -T use strict; BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval 'use Test::Mojibake'; plan skip_all => 'Test::Mojibake required for source encoding testing' if $@; all_files_encoding_ok(); =head1 OPERATION L validates codification of both source (Perl code) and documentation (POD). Both are assumed to be encoded in ISO-8859-1 (aka latin1). Perl switches to UTF-8 through the statement: use utf8; or: use utf8::all; or even: use common::sense; Similarly, POD encoding can be changed via: =encoding UTF-8 Correspondingly, C/C<=encoding latin1> put Perl back into ISO-8859-1 mode. Actually, L only cares about UTF-8, as it is roughly safe to be detected. So, when UTF-8 characters are detected without preceding declaration, an error is reported. On the other way, non-UTF-8 characters in UTF-8 mode are wrong, either. If present, L module (XS wrapper) will be used to validate UTF-8 strings, note that it is B<30 times faster> and a lot more Unicode Consortium compliant than the built-in Pure Perl implementation! UTF-8 BOM (Byte Order Mark) is also detected as an error. While Perl is OK handling BOM, your OS probably isn't. Check out: ./bom.pl: line 1: $'\357\273\277#!/usr/bin/perl': command not found =head2 Caveats Whole-line source comments, like: # this is a whole-line comment... print "### hello world ###\n"; # ...and this os not are not checked at all. This is mainly because many scripts/modules do contain authors' names in headers, B the proper encoding specification. So, if you happen to have some acutes/umlauts in your name and your editor sign your code in the similar way, you probably won't be happy with L flooding you with (false) error messages. If you are wondering why only whole-line comments are stripped, check the second line of the above example. =head1 SEE ALSO =over 4 =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =back =head1 ACKNOWLEDGEMENTS This module is based on L. Thanks to Andy Lester, David Wheeler, Paul Miller and Peter Edwards for contributions and to C for the original code. =head1 AUTHOR Stanislaw Pusep =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 by Stanislaw Pusep. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =head1 CONTRIBUTORS =for stopwords Dave Rolsky Hunter McMillen John SJ Anderson Karen Etheridge =over 4 =item * Dave Rolsky =item * Hunter McMillen =item * John SJ Anderson =item * Karen Etheridge =back =cut Test-Mojibake-1.3/bin/PaxHeader/scan_mojibake000755 777777 777777 00000000212 13046111753 024576 xustar00spoussepCORPAD\Domain Users000000 000000 17 gid=697783653 17 uid=699331736 20 ctime=1486394347 20 atime=1486394347 23 SCHILY.dev=16777220 23 SCHILY.ino=34838588 18 SCHILY.nlink=1 Test-Mojibake-1.3/bin/scan_mojibake000755 €)®ô˜€)—Ue00000003215 13046111753 023644 0ustar00spoussepCORPAD\Domain Users000000 000000 #!/usr/bin/perl # ABSTRACT: scan Perl source and report bad character encoding # PODNAME: scan_mojibake use strict; use warnings qw(all); our $VERSION = '1.3'; # VERSION use Pod::Usage; use Test::Mojibake; pod2usage( -exitval => 0, -verbose => 99, ) unless @ARGV; all_files_encoding_ok(@ARGV); __END__ =pod =encoding UTF-8 =head1 NAME scan_mojibake - scan Perl source and report bad character encoding =head1 VERSION version 1.3 =head1 SYNOPSIS scan_mojibake [FILES|DIRS] =head1 DESCRIPTION Standalone CLI wrapper for the L module. Does exactly the same as: perl -MTest::Mojibake -e 'all_files_encoding_ok(@ARGV)' bin/ lib/ t/*.t =head1 EXAMPLE $ scan_mojibake bin/ lib/ t/*.t 1..14 ok 1 - Mojibake test for bin/scan_mojibake ok 2 - Mojibake test for lib/Test/Mojibake.pm ok 3 - Mojibake test for t/00-load.t ok 4 - Mojibake test for t/01-bad-check.t ok 5 - Mojibake test for t/01-self-check.t ok 6 - Mojibake test for t/01-test-check.t ok 7 - Mojibake test for t/02-bad-source.t ok 8 - Mojibake test for t/02-good-source.t ok 9 - Mojibake test for t/03-bad-pod.t ok 10 - Mojibake test for t/03-good-pod.t ok 11 - Mojibake test for t/04-bom.t ok 12 - Mojibake test for t/05-encode.t ok 13 - Mojibake test for t/06-pp-vs-xs.t ok 14 - Mojibake test for t/07-broken-utf8.t =head1 SEE ALSO =over 4 =item * L =back =head1 AUTHOR Stanislaw Pusep =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 by Stanislaw Pusep. 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