Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the App-Cmd CPAN distribution.

Report information
The Basics
Id: 73131
Status: resolved
Priority: 0/
Queue: App-Cmd

People
Owner: Nobody in particular
Requestors: zengargoyle [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: App::Cmd::Tester 0.312 print vs say
Date: Fri, 9 Dec 2011 06:59:30 -0800
To: bug-App-Cmd [...] rt.cpan.org
From: zengargoyle <zengargoyle [...] gmail.com>
This may be in IO::TieCombine, I'm not really sure.  I was creating a simple App::Cmd application starter template and ran across this in testing. Using Test::Output to capture (like from old App::Cmd presentation slides) works with print: sub execute {  print "foo bar\n";  print "baz bat\n"; } like $stdout, qr/^foo bar$/m; like $stdout, qr/^baz bat$/m; and works with say: use 5.014; sub execute {  say "foo bar";  say "baz bat"; } like $stdout, qr/^foo bar$/m; like $stdout, qr/^baz bat$/m; But using App::Cmd::Tester fails when using say, the newlines get squashed.... like $result->stdout, qr/^foo bar$/m, "got foo bar"; like $result->stdout, qr/^baz bat$/m, "got baz bat"; but does work when using print.... Attached is a tarball of my reduced as much as possible test app. hayter@io:~/broken_app$ prove broken_app.t --verbose broken_app.t .. ok 1 ok 2 ok 3 ok 4 - got foo bar ok 5 - got baz bat ok 6 ok 7 ok 8 not ok 9 - got foo bar not ok 10 - got baz bat 1..10 #   Failed test 'got foo bar' #   at broken_app.t line 42. #                   'foo barbaz bat' #     doesn't match '(?^m:^foo bar$)' #   Failed test 'got baz bat' #   at broken_app.t line 43. #                   'foo barbaz bat' #     doesn't match '(?^m:^baz bat$)' # Looks like you failed 2 tests of 10. Dubious, test returned 2 (wstat 512, 0x200) Failed 2/10 subtests ---- zengargoyle
Download broken_app.tar.gz
application/x-gzip 718b

Message body not shown because it is not plain text.

You are correct. This is an IO::TieCombine bug, which will be fixed in the next release. Thanks very much for reporting this bug, it was informative – I learned that tied handles must respect $\ for "say" to work.