[Groonga-commit] ranguba/groonga-client at 19798c3 [master] Accept assignment not for _score

Back to archive index

Kouhei Sutou null+****@clear*****
Wed May 31 15:25:22 JST 2017


Kouhei Sutou	2017-05-31 15:25:22 +0900 (Wed, 31 May 2017)

  New Revision: 19798c309dbd7a41f22e1dd0d52e0f0ae0700922
  https://github.com/ranguba/groonga-client/commit/19798c309dbd7a41f22e1dd0d52e0f0ae0700922

  Message:
    Accept assignment not for _score

  Modified files:
    lib/groonga/client/request/select.rb
    test/request/select/test-scorer.rb

  Modified: lib/groonga/client/request/select.rb (+2 -2)
===================================================================
--- lib/groonga/client/request/select.rb    2017-05-31 15:24:51 +0900 (69aea77)
+++ lib/groonga/client/request/select.rb    2017-05-31 15:25:22 +0900 (2a3792a)
@@ -154,8 +154,8 @@ module Groonga
             case expression
             when /\A\s*\z/
               expression = nil
-            when /\A_score\s*=/
-              # have "_score ="
+            when /\A[_a-zA-Z\d]+\s*=/
+              # have assignment such as "_score = "
             else
               expression = "_score = #{expression}"
             end

  Modified: test/request/select/test-scorer.rb (+8 -0)
===================================================================
--- test/request/select/test-scorer.rb    2017-05-31 15:24:51 +0900 (ec5cbbe)
+++ test/request/select/test-scorer.rb    2017-05-31 15:25:22 +0900 (4732245)
@@ -54,6 +54,14 @@ class TestRequestSelectScorer < Test::Unit::TestCase
                    scorer(" \t\r\n"))
     end
 
+    def test_have_assignment
+      assert_equal({
+                     :table => "posts",
+                     :scorer => "persistent_score = _score",
+                   },
+                   scorer("persistent_score = %{score}", score: :_score))
+    end
+
     def test_symbol
       assert_equal({
                      :table => "posts",
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index