The following are both SHA256 hashes of an empty string, generated with PHP’s crypt function.
$5$fooooooooooooooo$Y6IVN.cYkABQ4h8dCR0zL/rJoRx09pwMoGaYST9HqDD
$5$baaaaaaaaaaaaaar$C84IKQdPMG8qvnnckGZsyBJWKHuaSD0tqcmyueHI0GA
Each was generated with a different 16 bytes of salt present in the hash.
Is there a way to merely test that they are hashes of the same thing, without knowing what that thing was?
No. The strings become completely unique once the salts are added, and there is no way of reversing a hashed string.