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

t/ack-pager.t fails on Cygwin #335

Open
tzccinct opened this issue Feb 26, 2021 · 1 comment
Open

t/ack-pager.t fails on Cygwin #335

tzccinct opened this issue Feb 26, 2021 · 1 comment

Comments

@tzccinct
Copy link

tzccinct commented Feb 26, 2021

The test t/ack-pager.t is skipped when IO::Pty is not installed, but when it is not skipped, it fails on Cygwin.
http://www.cpantesters.org/cpan/report/9e18340c-72c4-1014-ace7-3a9e76d8a230

    #   Failed test 'PAGER'
    #   at t/Util.pm line 585.
    #     Structures begin differing at:
    #          $got->[0] = '/usr/bin/env: `perl': No such file or directory'
    #     $expected->[0] = 't/text/raven.txt'
    # actual[
    #   '/usr/bin/env: `perl\': No such file or directory'
    # ]
    # expected[
    #   't/text/raven.txt',
    #   '55:    Quoth the Raven, "Nevermore."',
    #   '62:    With such name as "Nevermore."',
    #   '69:    Then the bird said, "Nevermore."',
    #   '76:    Of \'Never -- nevermore.\'',
    #   '83:    Meant in croaking "Nevermore."',
    #   '90:    She shall press, ah, nevermore!',
    #   '97:    Quoth the Raven, "Nevermore."',
    #   '104:    Quoth the Raven, "Nevermore."',
    #   '111:    Quoth the Raven, "Nevermore."',
    #   '118:    Quoth the Raven, "Nevermore."',
    #   '125:    Shall be lifted--nevermore!'
    # ]
    # Looks like you failed 1 test of 1.

It is because PATH environment variable is deleted from %ENV in t/Util.pm prep_environment(), then t/test-pager, whose shebang is #!/usr/bin/env perl, is tried to open. Deleting PATH has been introduced in ack 2.13_01 for taint mode (perl's -T option). The most apparent patch is not to delete PATH from %ENV, but I'm not sure if it's a correct approach.

@petdance
Copy link
Collaborator

Thanks for the report and the investigation.

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

No branches or pull requests

2 participants