Add tests for comparing candidate and final versions in packaging (#11841).

This used to be buggy; Filip Gruszczyński contributed tests and a code
patch but the latter is not needed.
1 file changed