[Groonga-commit] groonga/groonga-query-log at 8d64324 [master] response-comparer: support unary minus output case

アーカイブの一覧に戻る

Kouhei Sutou null+****@clear*****
Tue Jun 12 17:37:58 JST 2018


Kouhei Sutou	2018-06-12 17:37:58 +0900 (Tue, 12 Jun 2018)

  New Revision: 8d6432416037cd55fa10ba846cc6fa768121b319
  https://github.com/groonga/groonga-query-log/commit/8d6432416037cd55fa10ba846cc6fa768121b319

  Message:
    response-comparer: support unary minus output case

  Modified files:
    lib/groonga-query-log/response-comparer.rb
    test/test-response-comparer.rb

  Modified: lib/groonga-query-log/response-comparer.rb (+2 -0)
===================================================================
--- lib/groonga-query-log/response-comparer.rb    2018-06-12 17:34:45 +0900 (dc30556)
+++ lib/groonga-query-log/response-comparer.rb    2018-06-12 17:37:58 +0900 (ccaf1c7)
@@ -157,7 +157,9 @@ module GroongaQueryLog
             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

  Modified: test/test-response-comparer.rb (+9 -0)
===================================================================
--- test/test-response-comparer.rb    2018-06-12 17:34:45 +0900 (19b77b9)
+++ test/test-response-comparer.rb    2018-06-12 17:37:58 +0900 (7b95b35)
@@ -324,6 +324,15 @@ class ResponseComparerTest < Test::Unit::TestCase
           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
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180612/96bd0bec/attachment.htm 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る