Devel--Cover icon indicating copy to clipboard operation
Devel--Cover copied to clipboard

Setting $\ breaks Devel::Cover database

Open exodist opened this issue 5 years ago • 1 comments

magic_vars.t (reduced to minimal case)

use Test2::V0;
$\ = '|';
is($\, '|', 'set $\\');
done_testing

Result:

exodist@abydos main $ cover --delete; HARNESS_PERL_SWITCHES=-MDevel::Cover prove magic_vars.t; cover
Deleting database /home/exodist/yyy/cover_db
magic_vars.t .. ok   
All tests successful.
Files=1, Tests=1,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.22 cusr  0.02 csys =  0.26 CPU)
Result: PASS
Reading database from /home/exodist/yyy/cover_db
Can't read /home/exodist/yyy/cover_db/runs/1574743066.78287.28533/cover.14 with Cpanel::JSON::XS: garbage after JSON object, at character offset 542 (before "|") at /home/exodist/perl5/perlbrew/perls/main/lib/site_perl/5.30.0/x86_64-linux/Devel/Cover/DB/IO/JSON.pm line 35, <$fh> chunk 1.
Can't read /home/exodist/yyy/cover_db/structure/51e494bc7b1761e5ce198e718357a2b0 with Cpanel::JSON::XS: garbage after JSON object, at character offset 318 (before "|") at /home/exodist/perl5/perlbrew/perls/main/lib/site_perl/5.30.0/x86_64-linux/Devel/Cover/DB/IO/JSON.pm line 35, <$fh> chunk 1.

exodist avatar Nov 26 '19 04:11 exodist

I will note that many things probably break from this, so it is a low priority. In my case it is a test for Test2/Test::More that verifies the testing stuff does not explode if the var is set. For now I am having the test skip_all if it detects Devel::Cover is being used.

exodist avatar Nov 26 '19 04:11 exodist