Test query for rule matching.