Subject: | Test::Expr does not seem to work with __DATA__ |
Date: | Wed, 10 Jul 2019 18:44:37 +0000 |
To: | "bug-test-expr [...] rt.cpan.org" <bug-test-expr [...] rt.cpan.org> |
From: | Jeroen Paasschens <Jeroen.Paasschens [...] synopsys.com> |
Dear Mr. Conway,
It seems that Test::Expr somehow removes in-file DATA (using __DATA__).
A simple example:
use Test::Expr;
plan tests => 1;
my $data_content = do { local $/ = undef; <DATA>};
ok $data_content eq "content\n";
__DATA__
content
The error I get is
1..1
not ok 1 - $data_content eq "content\n"
# Failed test '$data_content eq "content\n"'
# at ./jp.pl line 17.
#
# (do{$data_content eq "content\n"}) was false
# because:
# $data_content --> ""
#
# Looks like you failed 1 test of 1.
Instead, when replacing Test::Expr with Test::More, the result is fine:
1..1
ok 1
My tests were run with perl 5.28.1.
package Test::Expr;
our $VERSION = '0.000005';
package PPR;
our $VERSION = '0.000022';
package Keyword::Declare;
our $VERSION = '0.001010';
package Keyword::Simple;
our $VERSION = '0.03'; (since 0.04 has issues on my perl).
I have no problem using Data::Dx, so Keyword::Declare is working as expected.
Best regards.
Show quoted text
________________________________________________________________
Jeroen Paasschens High Tech Campus 41-1.42, 5656 AE Eindhoven, The Netherlands +31 40 2304725