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

t/FrontMatter.t fails (with YAML::PP 0.013?) #4

Closed
eserte opened this issue May 1, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@eserte
Copy link

commented May 1, 2019

The test suite fails on some of my smokers:

#   Failed test 'error message [Missing one required key]'
#   at t/lib/Test/Code/TidyAll/Plugin/YAMLFrontMatter.pm line 45.
#   (in Test::Code::TidyAll::Plugin::YAMLFrontMatter->test_main)
#                   'Can't use string ("") as a HASH ref while "strict refs" in use at /usr/home/cpansand/.cpan/build/2019050109/Code-TidyAll-Plugin-YAMLFrontMatter-1.000002-3/blib/lib/Code/TidyAll/Plugin/YAMLFrontMatter.pm line 104.'
#     doesn't match '(?^:Missing required YAML Front Matter key: 'title')'
# Looks like you failed 1 test of 22.
t/FrontMatter.t ........ 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/22 subtests 

It seems that this happens if YAML::PP 0.013 is installed (@perlpunk: FYI):

****************************************************************
Regression 'mod:YAML::PP'
****************************************************************
Name           	       Theta	      StdErr	 T-stat
[0='const']    	      1.0000	      0.0000	28478852639028404.00
[1='eq_0.011'] 	     -0.0000	      0.0000	  -3.16
[2='eq_0.012'] 	     -0.0000	      0.0000	  -2.89
[3='eq_0.013'] 	     -1.0000	      0.0000	-27442909075363604.00

R^2= 1.000, N= 58, K= 4
****************************************************************
@perlpunk

This comment has been minimized.

Copy link

commented May 1, 2019

Oh I know why that happens! Sorry, this was an incompatible change in 0.013 which should in many cases have no effect, but here it has.

I changed the default Schema to JSON instead of Core. In the JSON Schema empty nodes resolve to empty strings instead of null, though.

That's why this line:

$ds->{$_}

is failing now with Can't use string ("") as a HASH ref. It was previously working when $ds was undef.

So you could either first check if you got a hashref, or use the Core schema explicitly:

YAML::PP->new( schema => [qw/ Core /] )

2shortplanks added a commit that referenced this issue May 1, 2019

2shortplanks added a commit that referenced this issue May 1, 2019

@oschwald

This comment has been minimized.

Copy link
Member

commented May 17, 2019

This was fixed in 1.000003.

@oschwald oschwald closed this May 17, 2019

@eserte

This comment has been minimized.

Copy link
Author

commented May 17, 2019

Now it's the other way around: it fails with older YAML::PP (< 0.012?):

****************************************************************
Regression 'mod:YAML::PP'
****************************************************************
Name           	       Theta	      StdErr	 T-stat
[0='const']    	     -0.0000	      0.0000	  -1.28
[1='eq_0.009'] 	      0.0000	      0.0000	   0.55
[2='eq_0.012'] 	      1.0000	      0.0000	4698060028925257.00
[3='eq_0.013'] 	      1.0000	      0.0000	4068639333553526.50
[4='eq_0.014'] 	      1.0000	      0.0000	4068639333553525.00
[5='eq_0.015'] 	      1.0000	      0.0000	5642187591729565.00

R^2= 1.000, N= 33, K= 6
****************************************************************

Probably a minimum prereq version should be set?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.