Skip to content

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

Description

@vpit

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions