Subject: | Nested test functions do not work |
This test:
cmp_deeply(
$json_string,
json(code( sub { return 0 } )),
);
does not work, with the error:
Use of uninitialized value $diag in substitution (s///) at /Users/ether/.perlbrew/libs/19.8@std/lib/perl5/Test/Deep.pm line 225.
This is because diagnostics() is being called, but the inner object is not being called to get the error message.
The fix is the same I did here, for Test::Deep::YAML: https://github.com/karenetheridge/Test-Deep-YAML/commit/9c7e0b3a898b9a66fd1bed55c677b2e1610e7c63