I encountered this code at work, roughly:
cmp_deeply(
$test_data,
superhashof({ assertion-one }, { assertion-two }),
"two assertions about data are correct",
);
This seems to the casual reader like it asserts that $test_data is a superhash of both of the given hashrefs to superhashof. Instead, arguments after the first to superhashof are silently discarded meaning that the test appears to assert more than it does. This makes the tests less valuable for no gain.
In cases like the above, Test::Deep should raise an exception.
I encountered this code at work, roughly:
This seems to the casual reader like it asserts that
$test_datais a superhash of both of the given hashrefs tosuperhashof. Instead, arguments after the first tosuperhashofare silently discarded meaning that the test appears to assert more than it does. This makes the tests less valuable for no gain.In cases like the above, Test::Deep should raise an exception.