comparison validator and its test