Add tests for query comparison.