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

dist/Data-Dumper/t/dumper.t: fails with warnings on by default #317

Closed
jkeenan opened this issue Oct 24, 2020 · 1 comment
Closed

dist/Data-Dumper/t/dumper.t: fails with warnings on by default #317

jkeenan opened this issue Oct 24, 2020 · 1 comment
Assignees
Labels
question Further information is requested or policy needs discussion warnings-by-default

Comments

@jkeenan
Copy link
Collaborator

jkeenan commented Oct 24, 2020

Turning on warnings-by-default causes dist/Data-Dumper/t/dumper.t to fail.

In the alpha branch, this test file PASSes. So it's okay with strict-by-default. However, in the alpha-dev-03-warnings branch, I get:

$ cd t; ./perl harness ../dist/Data-Dumper/t/dumper.t; cd -
../dist/Data-Dumper/t/dumper.t .. Failed 2/468 subtests 

Test Summary Report
-------------------
../dist/Data-Dumper/t/dumper.t (Wstat: 0 Tests: 468 Failed: 2)
  Failed tests:  223, 225
Files=1, Tests=468,  1 wallclock secs ( 0.05 usr  0.00 sys +  0.18 cusr  0.02 csys =  0.25 CPU)
Result: FAIL

The failures:

ok 220 - more sortkeys sub (XS)
ok 221 -   no eval error
ok 222 -   works a 2nd time after intervening eval
not ok 223 X - Deparse 1: Indent 2; Dump()
ok 224 -   no eval error
not ok 225 -  re-evaled version 
ok 226 - Numbers

Or:

$ ./perl -Ilib -Idist/Data-Dumper/lib dist/Data-Dumper/t/dumper.t
...
ok 222 -   works a 2nd time after intervening eval
not ok 223 X - Deparse 1: Indent 2; Dump()
--Expected--
 #$VAR1 = {
 #          foo => sub {
 #                     use strict;
 #                     print 'foo';
 #                 }
 #        };

--Got--
 #$VAR1 = {
 #          foo => sub {
 #                     use warnings;
 #                     use strict;
 #                     print 'foo';
 #                 }
 #        };

ok 224 -   no eval error
not ok 225 -  re-evaled version 
--Expected--
 #$VAR1 = {
 #          foo => sub {
 #                     use strict;
 #                     print 'foo';
 #                 }
 #        };

--Got--
 #$VAR1 = {
 #          foo => sub {
 #                     use warnings;
 #                     use strict;
 #                     print 'foo';
 #                 }
 #        };

ok 226 - Numbers
...

So it appears that turning on $Data::Dumper::Deparse causes the output of Dump to change.

This is easy enough to correct -- just include use warnings in the WANT. But before I do that, I want to know that this change of behavior is expected.

@atoomic, can you take a look?

Thank you very much.
Jim Keenan

@jkeenan
Copy link
Collaborator Author

jkeenan commented Oct 27, 2020

I infer from the fact that @atoomic merged the associated p.r. that my understanding was correct. So this ticket can be closed.

Thank you very much.
Jim Keenan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested or policy needs discussion warnings-by-default
Projects
None yet
Development

No branches or pull requests

2 participants