Navigation Menu

Skip to content

Commit

Permalink
response-comparer: need more loose normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 18, 2018
1 parent b354d4b commit 10def08
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/groonga-query-log/response-comparer.rb
Expand Up @@ -271,7 +271,7 @@ def normalize_value(value, column)
type = column[1]
case type
when "Float"
value.round(12)
value.round(10)
else
value
end
Expand Down
12 changes: 6 additions & 6 deletions test/test-response-comparer.rb
Expand Up @@ -337,26 +337,26 @@ def create_response(latitude, longitude)
end

def test_all_output_columns
response1 = create_response(35.6562002690605, 139.763570507358)
response2 = create_response(35.65620026906051, 139.7635705073576)
response1 = create_response(35.6705996342355, 139.683422370535)
response2 = create_response(35.67059963423547, 139.6834223705349)
assert do
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)
response1 = create_response(35.6705996342355, 139.683422370535)
response2 = create_response(35.67059963423547, 139.6834223705349)
assert do
same?(response1, response2)
end
end

def test_specific_output_columns
@command["output_columns"] = "_id, latitude, longitude"
response1 = create_response(35.6562002690605, 139.763570507358)
response2 = create_response(35.65620026906051, 139.7635705073576)
response1 = create_response(35.6705996342355, 139.683422370535)
response2 = create_response(35.67059963423547, 139.6834223705349)
assert do
same?(response1, response2)
end
Expand Down

0 comments on commit 10def08

Please sign in to comment.