Navigation Menu

Skip to content

Commit

Permalink
response-comparer: support unary minus output case
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 12, 2018
1 parent c3319a5 commit 8d64324
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/groonga-query-log/response-comparer.rb
Expand Up @@ -157,7 +157,9 @@ def same_records_unary_minus_output_column?
next
end
value1 = record1[column_index1]
value1 = normalize_value(value1, columns1[column_index1])
value2 = record2[column_index2]
value2 = normalize_value(value2, columns2[column_index2])
return false if value1 != value2
end
end
Expand Down
9 changes: 9 additions & 0 deletions test/test-response-comparer.rb
Expand Up @@ -324,6 +324,15 @@ def test_all_output_columns
same?(response1, response2)
end
end

def test_unary_minus_output_column
@command["output_columns"] = "_id, -value, latitude, longitude"
response1 = create_response(35.6562002690605, 139.763570507358)
response2 = create_response(35.65620026906051, 139.7635705073576)
assert do
same?(response1, response2)
end
end
end

class ErrorTest < self
Expand Down

0 comments on commit 8d64324

Please sign in to comment.