3 ms·
Hopefully, it wouldn't match the algorithm. It's implementing it two different ways and comparing the results. It's not a guarantee, since you could have imple
by skybrian 2y ago
Hopefully, it wouldn't match the algorithm.
It's implementing it two different ways and comparing the results. It's not a guarantee, since you could have implemented the wrong spec, but there's only so much you can do with internal consistency checks.
But it would be better to compare to a known good function. It might be easier to add a dependency to do that in a test than in production code.