Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failures when the path to the dist dir contains a 't' #3

Open
vpit opened this issue Oct 7, 2013 · 1 comment
Open

Test failures when the path to the dist dir contains a 't' #3

vpit opened this issue Oct 7, 2013 · 1 comment

Comments

@vpit
Copy link

vpit commented Oct 7, 2013

Hello,

When this distribution is built and tested from a directory that has a 't' directory segment in its path, the basic.t test rightfully fails. This is very easy to replicate :

10:55:54 vince@net90135 /tmp/t/Path-FindDev
$ perl5.18.1 -Ilib t/basic.t
ok 1 - find_dev returned something
ok 2 - found and expected match
# External search started at /private/tmp/t
not ok 3 - Finding a dev directory above the project directory should miss
#   Failed test 'Finding a dev directory above the project directory should miss'
#   at t/basic.t line 45.
#          got: '/private/tmp'
#     expected: undef
# As the previous test failed, debug diagnosics for Path::IsDev are being turned on
# These will hopefully tell you what warts your filesystem has that results in false-postives for dev dirs
[Path::FindDev=0] Finding dev for /private/tmp/t
[Path::IsDev=0] Matching /private/tmp/t
[Path::IsDev=0] no match found
[Path::FindDev=0] Trying ../ : /private/tmp
[Path::IsDev=0] Matching /private/tmp
[Path::IsDev=0] /private/tmp/t exists for Path::IsDev::Heuristic::TestDir
[Path::IsDev=0] ::TestDir matched path /private/tmp
[Path::FindDev=0] Found dev dir/private/tmp
1..3
# Looks like you failed 1 test of 3.

(On darwin, /tmp is a link to /private/tmp)

This causes errors like http://www.cpantesters.org/cpan/report/5a0e163a-2f56-11e3-b548-9a76fe37c12b, where I run CPANPLUS from a temporary directory that happens to have a 'T' in it, and since paths on darwin are case-insensitive, you get the same issue.

I suggest you to not look above the root directory of your distribution in your test, and to test the correctness of your module with mock premade paths bundled with your dist.

@vpit
Copy link
Author

vpit commented Oct 7, 2013

It also looks like a space is missing from the debug line "[Path::FindDev=0] Found dev dir/private/tmp"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant