Permalink
Browse files

check both args with Path::Tiny and dzilify

  • Loading branch information...
1 parent b9d331b commit 49908b051eaec2c67be2fcdbbde7f6682561ac6c @xdg xdg committed Jan 31, 2013
Showing with 107 additions and 760 deletions.
  1. +2 −0 .gitignore
  2. +0 −27 Build.PL
  3. +50 −0 CONTRIBUTING
  4. +8 −0 Changes
  5. +0 −18 INSTALL
  6. +0 −201 LICENSE
  7. +0 −20 MANIFEST
  8. +0 −31 MANIFEST.SKIP
  9. +0 −26 META.yml
  10. +0 −16 Makefile.PL
  11. +0 −88 README
  12. +11 −0 dist.ini
  13. +0 −56 inc/Module/Build/WikiDoc.pm
  14. +36 −94 lib/Test/Filename.pm
  15. +0 −114 lib/Test/Filename.pod
  16. +0 −27 t/00_load.t
  17. +0 −4 xt/criticrc
  18. +0 −9 xt/perl-critic.t
  19. +0 −22 xt/pod-coverage.t
  20. +0 −7 xt/pod.t
View
2 .gitignore
@@ -0,0 +1,2 @@
+/Test-Filename*
+/.build
View
27 Build.PL
@@ -1,27 +0,0 @@
-use strict;
-use lib 'inc';
-eval "require Pod::WikiDoc";
-my $class = $@ ? "Module::Build" : "Module::Build::WikiDoc";
-eval "require $class";
-$class->new(
- module_name => 'Test::Filename',
- dist_author => 'David A. Golden <dagolden@cpan.org>',
- license => 'apache',
- create_readme => 1,
- create_makefile_pl => 'traditional',
- requires => {
- 'Test::More' => 0.62, # various features/fixes
- },
- build_requires => {
- 'File::Spec' => 0,
- 'Test::Tester' => 0.08,
- },
- meta_add => {
- no_index => {
- directory => [ qw{
- examples
- inc
- }],
- }
- },
-)->create_build_script;
View
50 CONTRIBUTING
@@ -0,0 +1,50 @@
+CONTRIBUTING
+
+Thank you for considering contributing to this distribution. This file
+contains instructions that will help you work with the source code.
+
+The distribution is managed with Dist::Zilla. This means than many of the
+usual files you might expect are not in the repository, but are generated
+at release time (e.g. Makefile.PL).
+
+However, you can run tests directly using the 'prove' tool:
+
+ $ prove -l
+ $ prove -lv t/some_test_file.t
+
+For most distributions, 'prove' is entirely sufficent for you to test any
+patches you have.
+
+You may need to satisfy some dependencies. See the included META.json
+file for a list. If you install App::mymeta_requires from CPAN, it's easy
+to satisfy any that you are missing by piping the output to your favorite
+CPAN client:
+
+ $ mymeta-requires | cpanm
+ $ cpan `mymeta-requires`
+
+Likewise, much of the documentation Pod is generated at release time.
+Depending on the distribution, some documentation may be written in a Pod
+dialect called WikiDoc. (See Pod::WikiDoc on CPAN.) If you would like to
+submit a documentation edit, please limit yourself to the documentation you
+see.
+
+If you see typos or documentation issues in the generated docs, please
+email or open a bug ticket instead of patching.
+
+Dist::Zilla is a very powerful authoring tool, but requires a number of
+author-specific plugins. If you would like to use it for contributing,
+install it from CPAN, then run one of the following commands, depending on
+your CPAN client:
+
+ $ cpan `dzil authordeps`
+ $ dzil authordeps | cpanm
+
+Once installed, here are some dzil commands you might try:
+
+ $ dzil build
+ $ dzil test
+ $ dzil xtest
+
+You can learn more about Dist::Zilla at http://dzil.org/
+
View
8 Changes
@@ -1,5 +1,13 @@
Revision history for Perl module Test::Filename
+{{$NEXT}}
+
+ - Now converts both comparison arguments and does so with
+ Path::Tiny to handle minor details like "./foo" being
+ the same as "foo"
+
+ - Converted distribution management to Dist::Zilla
+
0.02 Sat Oct 6 13:28:46 EDT 2007
- Fixes bug on win32 (PIBK)
View
18 INSTALL
@@ -1,18 +0,0 @@
-INSTALLATION
-
-If Module::Build is installed (preferred):
-
- perl Build.PL
- perl Build
- perl Build test
- perl Build install
-
-Otherwise, using a Makefile:
-
- perl Makefile.PL
- make
- make test
- make install
-
-If you are on a Windows machine you should use 'nmake' or 'dmake' rather than
-'make'.
View
201 LICENSE
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
View
20 MANIFEST
@@ -1,20 +0,0 @@
-Build.PL
-Changes
-examples/simple.t
-inc/Module/Build/WikiDoc.pm
-INSTALL
-lib/Test/Filename.pm
-lib/Test/Filename.pod
-LICENSE
-Makefile.PL
-MANIFEST This list of files
-MANIFEST.SKIP
-META.yml
-README
-t/00_load.t
-t/filename_is.t
-Todo
-xt/criticrc
-xt/perl-critic.t
-xt/pod-coverage.t
-xt/pod.t
View
31 MANIFEST.SKIP
@@ -1,31 +0,0 @@
-# Version control files and dirs.
-\bRCS\b
-\bCVS\b
-,v$
-.svn/
-
-# ExtUtils::MakeMaker generated files and dirs.
-^MANIFEST\.(?!SKIP)
-^Makefile$
-^blib/
-^blibdirs$
-^PM_to_blib$
-^pm_to_blib$
-^MakeMaker-\d
-
-# Module::Build
-^Build$
-^_build
-.bat$
-
-# Coverage
-^cover_db
-
-# Temp, old, vi and emacs files.
-~$
-\.old$
-^#.*#$
-^\.#
-\.swp$
-\.bak$
-\.tmp$
View
26 META.yml
@@ -1,26 +0,0 @@
----
-name: Test-Filename
-version: 0.02
-author:
- - 'David A. Golden <dagolden@cpan.org>'
-abstract: Portable filename comparison
-license: apache
-resources:
- license: http://apache.org/licenses/LICENSE-2.0
-requires:
- Test::More: 0.62
-build_requires:
- File::Spec: 0
- Test::Tester: 0.08
-provides:
- Test::Filename:
- file: lib/Test/Filename.pm
- version: 0.02
-generated_by: Module::Build version 0.2808
-meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.2.html
- version: 1.2
-no_index:
- directory:
- - examples
- - inc
View
16 Makefile.PL
@@ -1,16 +0,0 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.03
-use ExtUtils::MakeMaker;
-WriteMakefile
-(
- 'PL_FILES' => {},
- 'INSTALLDIRS' => 'site',
- 'NAME' => 'Test::Filename',
- 'EXE_FILES' => [],
- 'VERSION_FROM' => 'lib/Test/Filename.pm',
- 'PREREQ_PM' => {
- 'Test::More' => '0.62',
- 'File::Spec' => 0,
- 'Test::Tester' => '0.08'
- }
- )
-;
View
88 README
@@ -1,88 +0,0 @@
-NAME
- Test::Filename - Portable filename comparison
-
-VERSION
- This documentation describes version 0.02.
-
-SYNOPSIS
- use Test::Filename tests => 2;
-
- filename_is ( "some\path", "some/path", "should pass" );
- filename_isnt( "some\path", "some/path", "should fail" );
-
-DESCRIPTION
- Many cross-platform test failures -- particularly on Win32 -- are due to
- hard-coded file paths being used in comparison tests.
-
- my $file = get_file(); # returns "foo\bar.t";
- is( $file, "foo/bar.t" ); # fails on Win32
-
- This simple module provides some handy functions to convert all those
- path separators automatically so filename tests will just DWIM.
-
- The alternative is to write your own utility subroutine and use it
- everywhere or just keep on littering your test code with calls to
- File::Spec -- yuck!
-
- is( $file, File::Spec->canonpath("some/path"), "should pass" );
-
- Since this module is so simple, you might not think it worth including
- as a "build_requires" dependency. After all, it's not *that* hard to
- always remember to use File::Spec, right? But odds are that, at some
- point, you'll be so busy writing tests that you'll forget and hard-code
- a path in your haste to show what a clever programmer you are.
-
- So just use this module and stop worrying about it. You'll be happier
- and so will anyone trying to install your modules on Win32.
-
-USAGE
- Just like Test::More, you have the option of providing a test plan as
- arguments when you "use" this module. The following functions are
- imported by default.
-
- filename_is
- filename_isnt
- filename_is ( $got, $expected, $label );
- filename_isnt( $got, $expected, $label );
-
- These functions work just like "is()" and "isnt()" from Test::More, but
- the first argument will have native path separators converted to forward
- slashes before comparison. The $expected argument must use unix-style
- forward slashes as path separators.
-
-BUGS
- Please report any bugs or feature using the CPAN Request Tracker. Bugs
- can be submitted through the web interface at
- <http://rt.cpan.org/Dist/Display.html?Queue=Test-Filename>
-
- When submitting a bug or request, please include a test-file or a patch
- to an existing test-file that illustrates the bug or desired feature.
-
-SEE ALSO
- * perlport
-
- * File::Spec
-
- * Test::More
-
-AUTHOR
- David A. Golden (DAGOLDEN)
-
-COPYRIGHT AND LICENSE
- Copyright (c) 2007 by David A. Golden
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at <http://www.apache.org/licenses/LICENSE-2.0>
-
- Files produced as output though the use of this software, including
- generated copies of boilerplate templates provided with this software,
- shall not be considered Derivative Works, but shall be considered the
- original work of the Licensor.
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
View
11 dist.ini
@@ -0,0 +1,11 @@
+name = Test-Filename
+author = David A. Golden <dagolden@cpan.org>
+license = Apache_2_0
+copyright_holder = David A. Golden
+copyright_year = 2007
+
+[@DAGOLDEN]
+:version = 0.036
+AutoMetaResources.bugtracker.rt = 0
+AutoMetaResources.bugtracker.github = user:dagolden
+
View
56 inc/Module/Build/WikiDoc.pm
@@ -1,56 +0,0 @@
-package Module::Build::WikiDoc;
-use strict;
-use base qw/Module::Build/;
-use File::Spec;
-
-sub ACTION_wikidoc {
- my $self = shift;
- eval "use Pod::WikiDoc";
- if ( $@ eq '' ) {
- my $parser = Pod::WikiDoc->new({
- comment_blocks => 1,
- keywords => { VERSION => $self->dist_version },
- });
- for my $src ( keys %{ $self->find_pm_files() } ) {
- (my $tgt = $src) =~ s{\.pm$}{.pod};
- $parser->filter( {
- input => $src,
- output => $tgt,
- });
- print "Creating $tgt\n";
- $tgt =~ s{\\}{/}g;
- $self->_add_to_manifest( 'MANIFEST', $tgt );
- }
- }
- else {
- warn "Pod::WikiDoc not available. Skipping wikidoc.\n";
- }
-}
-
-sub ACTION_test {
- my $self = shift;
- my $missing_pod;
- for my $src ( keys %{ $self->find_pm_files() } ) {
- (my $tgt = $src) =~ s{\.pm$}{.pod};
- $missing_pod = 1 if ! -e $tgt;
- }
- if ( $missing_pod ) {
- $self->depends_on('wikidoc');
- $self->depends_on('build');
- }
- $self->SUPER::ACTION_test;
-}
-
-sub ACTION_testpod {
- my $self = shift;
- $self->depends_on('wikidoc');
- $self->SUPER::ACTION_testpod;
-}
-
-sub ACTION_distdir {
- my $self = shift;
- $self->depends_on('wikidoc');
- $self->SUPER::ACTION_distdir;
-}
-
-1;
View
130 lib/Test/Filename.pm
@@ -1,18 +1,18 @@
-package Test::Filename;
-use 5.004;
+use 5.006;
use strict;
-use vars qw/$VERSION @ISA @EXPORT/;
-use Config;
+use warnings;
+package Test::Filename;
+# ABSTRACT: Portable filename comparison
+# VERSION
+
use Test::Builder::Module;
+use Path::Tiny;
-BEGIN {
- $VERSION = '0.02';
- @ISA = qw/Test::Builder::Module/;
- @EXPORT = qw(
- filename_is
- filename_isnt
- );
-}
+our @ISA = qw/Test::Builder::Module/;
+our @EXPORT = qw(
+ filename_is
+ filename_isnt
+);
my $CLASS = __PACKAGE__;
@@ -22,52 +22,27 @@ my $CLASS = __PACKAGE__;
sub filename_is {
my($got, $expected, $label) = @_;
- return $CLASS->builder->is_eq(_path($got), $expected, $label);
+ return $CLASS->builder->is_eq(path($got), path($expected), $label);
}
sub filename_isnt {
my($got, $expected, $label) = @_;
- return $CLASS->builder->isnt_eq(_path($got), $expected, $label);
-}
-
-#--------------------------------------------------------------------------#
-# private functions
-#--------------------------------------------------------------------------#
-
-sub _path {
- my ($path) = @_;
- return $path unless $^O =~ m{^MS};
- $path =~ s{\\}{/}g;
- return $path;
+ return $CLASS->builder->isnt_eq(path($got), path($expected), $label);
}
-1; #modules must return true
+1;
__END__
-#--------------------------------------------------------------------------#
-# pod documentation
-#--------------------------------------------------------------------------#
-
-=begin wikidoc
-
-= NAME
-
-Test::Filename - Portable filename comparison
-
-= VERSION
-
-This documentation describes version %%VERSION%%.
-
-= SYNOPSIS
+=head1 SYNOPSIS
use Test::Filename tests => 2;
filename_is ( "some\path", "some/path", "should pass" );
filename_isnt( "some\path", "some/path", "should fail" );
-= DESCRIPTION
+=head1 DESCRIPTION
Many cross-platform test failures -- particularly on Win32 -- are due to
hard-coded file paths being used in comparison tests.
@@ -83,71 +58,38 @@ or just keep on littering your test code with calls to File::Spec -- yuck!
is( $file, File::Spec->canonpath("some/path"), "should pass" );
-Since this module is so simple, you might not think it worth including
-as a {build_requires} dependency. After all, it's not ~that~ hard to
-always remember to use [File::Spec], right? But odds are that, at some point,
-you'll be so busy writing tests that you'll forget and hard-code a path in
-your haste to show what a clever programmer you are.
+Since this module is so simple, you might not think it worth including as a
+dependency. After all, it's not I<that> hard to always remember to use
+L<File::Spec>, L<Path::Tiny> or some other file utility, right? But odds are
+that, at some point, you'll be so busy writing tests that you'll forget and
+hard-code a path in your haste to show what a clever programmer you are.
So just use this module and stop worrying about it. You'll be happier
and so will anyone trying to install your modules on Win32.
-= USAGE
+=head1 USAGE
Just like Test::More, you have the option of providing a test plan
-as arguments when you {use} this module. The following functions are
+as arguments when you use this module. The following functions are
imported by default.
-== filename_is
-== filename_isnt
+=head2 filename_is
+=head2 filename_isnt
filename_is ( $got, $expected, $label );
filename_isnt( $got, $expected, $label );
-These functions work just like {is()} and {isnt()} from Test::More, but
-the first argument will have native path separators converted to forward
-slashes before comparison. The {$expected} argument must use unix-style
-forward slashes as path separators.
-
-= BUGS
-
-Please report any bugs or feature using the CPAN Request Tracker.
-Bugs can be submitted through the web interface at
-[http://rt.cpan.org/Dist/Display.html?Queue=Test-Filename]
-
-When submitting a bug or request, please include a test-file or a patch to an
-existing test-file that illustrates the bug or desired feature.
-
-= SEE ALSO
-
-* [perlport]
-* [File::Spec]
-* [Test::More]
-
-= AUTHOR
-
-David A. Golden (DAGOLDEN)
-
-= COPYRIGHT AND LICENSE
-
-Copyright (c) 2007 by David A. Golden
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-[http://www.apache.org/licenses/LICENSE-2.0]
-
-Files produced as output though the use of this software, including
-generated copies of boilerplate templates provided with this software,
-shall not be considered Derivative Works, but shall be considered the
-original work of the Licensor.
+These functions work just like C<is()> and C<isnt()> from Test::More, but
+the first two argument will be cleaned up and normalized to Unix-style
+paths using L<Path::Tiny>. This means that C<.\foo.txt> will get normalized
+to C<foo.txt> and so on.
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
+=head1 SEE ALSO
-=end wikidoc
+=for :list
+* L<perlport>
+* L<File::Spec>
+* L<Path::Tiny>
+* L<Test::More>
=cut
View
114 lib/Test/Filename.pod
@@ -1,114 +0,0 @@
-# Generated by Pod::WikiDoc version 0.18
-
-=pod
-
-=head1 NAME
-
-Test::Filename - Portable filename comparison
-
-=head1 VERSION
-
-This documentation describes version 0.02.
-
-=head1 SYNOPSIS
-
- use Test::Filename tests => 2;
-
- filename_is ( "some\path", "some/path", "should pass" );
- filename_isnt( "some\path", "some/path", "should fail" );
-
-=head1 DESCRIPTION
-
-Many cross-platform test failures -- particularly on Win32 -- are due to
-hard-coded file paths being used in comparison tests.
-
- my $file = get_file(); # returns "foo\bar.t";
- is( $file, "foo/bar.t" ); # fails on Win32
-
-This simple module provides some handy functions to convert all those
-path separators automatically so filename tests will just DWIM.
-
-The alternative is to write your own utility subroutine and use it everywhere
-or just keep on littering your test code with calls to File::Spec -- yuck!
-
- is( $file, File::Spec->canonpath("some/path"), "should pass" );
-
-Since this module is so simple, you might not think it worth including
-as a C<<< build_requires >>> dependency. After all, it's not I<that> hard to
-always remember to use L<File::Spec>, right? But odds are that, at some point,
-you'll be so busy writing tests that you'll forget and hard-code a path in
-your haste to show what a clever programmer you are.
-
-So just use this module and stop worrying about it. You'll be happier
-and so will anyone trying to install your modules on Win32.
-
-=head1 USAGE
-
-Just like Test::More, you have the option of providing a test plan
-as arguments when you C<<< use >>> this module. The following functions are
-imported by default.
-
-=head2 filename_is
-
-=head2 filename_isnt
-
- filename_is ( $got, $expected, $label );
- filename_isnt( $got, $expected, $label );
-
-These functions work just like C<<< is() >>> and C<<< isnt() >>> from Test::More, but
-the first argument will have native path separators converted to forward
-slashes before comparison. The C<<< $expected >>> argument must use unix-style
-forward slashes as path separators.
-
-=head1 BUGS
-
-Please report any bugs or feature using the CPAN Request Tracker.
-Bugs can be submitted through the web interface at
-L<http://rt.cpan.org/Dist/Display.html?Queue=Test-Filename>
-
-When submitting a bug or request, please include a test-file or a patch to an
-existing test-file that illustrates the bug or desired feature.
-
-=head1 SEE ALSO
-
-=over
-
-=item *
-
-L<perlport>
-
-=item *
-
-L<File::Spec>
-
-=item *
-
-L<Test::More>
-
-=back
-
-=head1 AUTHOR
-
-David A. Golden (DAGOLDEN)
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright (c) 2007 by David A. Golden
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-L<http://www.apache.org/licenses/LICENSE-2.0>
-
-Files produced as output though the use of this software, including
-generated copies of boilerplate templates provided with this software,
-shall not be considered Derivative Works, but shall be considered the
-original work of the Licensor.
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-
View
27 t/00_load.t
@@ -1,27 +0,0 @@
-use strict;
-BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } }
-
-select(STDERR); $|=1;
-select(STDOUT); $|=1;
-
-use Test::More;
-
-my @api = qw(
- filename_is
- filename_isnt
-);
-
-plan tests => 1 + 2 * @api;
-
-#--------------------------------------------------------------------------#
-
-require_ok( 'Test::Filename' );
-
-can_ok( 'Test::Filename', $_ ) for @api;
-
-package ThisPackage;
-
-Test::Filename->import();
-
-main::can_ok( 'ThisPackage', $_ ) for @api;
-
View
4 xt/criticrc
@@ -1,4 +0,0 @@
-severity = 4
-
-exclude = ProhibitStringyEval RequireUseWarnings
-include = Lax::ProhibitStringyEvalExceptForRequire
View
9 xt/perl-critic.t
@@ -1,9 +0,0 @@
-use strict;
-use warnings;
-use File::Spec;
-use Test::More;
-require Test::Perl::Critic;
-
-my $rcfile = File::Spec->catfile( 'xt', 'criticrc' );
-Test::Perl::Critic->import( -profile => $rcfile );
-all_critic_ok( 'lib' );
View
22 xt/pod-coverage.t
@@ -1,22 +0,0 @@
-use Test::More;
-
-my $min_tpc = 1.08;
-eval "use Test::Pod::Coverage $min_tpc";
-plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage"
- if $@;
-
-my $min_pc = 0.17;
-eval "use Pod::Coverage $min_pc";
-plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage"
- if $@;
-
-my @modules = all_modules('lib');
-
-plan tests => scalar @modules;
-
-for my $mod ( @modules ) {
- my $doc = "lib/$mod\.pod";
- $doc =~ s{::}{/}g;
- pod_coverage_ok( $mod, { pod_from => $doc } );
-}
-
View
7 xt/pod.t
@@ -1,7 +0,0 @@
-use Test::More;
-
-my $min_tp = 1.22;
-eval "use Test::Pod $min_tp";
-plan skip_all => "Test::Pod $min_tp required for testing POD" if $@;
-
-all_pod_files_ok();

0 comments on commit 49908b0

Please sign in to comment.