Subject: | Strip extra newlines |
I got failure test reports for CPAN::Command, because something loaded from CPAN.pm
sometimes prints an extra newline. Miyagawa had that error as well. Here is an IRC
conversation:
09:03 hanekomu_: any idea why this failure could occur?
http://www.cpantesters.org/cpan/report/7003836
09:03 hanekomu_: It works on my machine; the program that fails is
http://cpansearch.perl.org/src/MARCEL/CPAN-Command-1.100840/t/00-compile.t
09:04 hanekomu_: no idea where this extra newline comes from...
09:12 miyagawa: hanekomu_: i remember that error
09:14 miyagawa: some modules loaded in the chain prints something to STDOUT
09:15 miyagawa:
http://github.com/miyagawa/cpanminus/commit/b9efaad39589bc72552a95c2a113779e3fa
3f4f8
09:16 miyagawa: i didn't figure out which code it really was
09:16 miyagawa: but something in the chain loaded by CPAN.pm prints \n to STDOUT
So if you either strip whitespace before the 'OK' line or use a regex to test the output, that
should work.
Thank you,
Marcel