Added unit tests for compare functions.