[Groonga-commit] groonga/grntest [master] Follow Groonga::Command::Parser's improvement

Zurück zum Archiv-Index

Haruka Yoshihara null+****@clear*****
Wed Dec 5 17:47:17 JST 2012


Haruka Yoshihara	2012-12-05 17:47:17 +0900 (Wed, 05 Dec 2012)

  New Revision: 4f2beb82da32db262835462ea9a22f6b6f90110b
  https://github.com/groonga/grntest/commit/4f2beb82da32db262835462ea9a22f6b6f90110b

  Log:
    Follow Groonga::Command::Parser's improvement

  Modified files:
    lib/grntest/tester.rb
    test/test-executor.rb

  Modified: lib/grntest/tester.rb (+2 -14)
===================================================================
--- lib/grntest/tester.rb    2012-11-27 22:34:44 +0900 (7167149)
+++ lib/grntest/tester.rb    2012-12-05 17:47:17 +0900 (0d5817e)
@@ -22,7 +22,6 @@ require "fileutils"
 require "tempfile"
 require "shellwords"
 require "open-uri"
-require "cgi/util"
 
 require "json"
 require "msgpack"
@@ -1643,19 +1642,8 @@ EOF
       end
 
       def to_url
-        command = nil
-        arguments = nil
-        load_values = ""
-        @gqtp_command.each_line.with_index do |line, i|
-          if i.zero?
-            command = Groonga::Command::Parser.parse(line)
-          else
-            load_values << line
-          end
-        end
-        url = command.to_uri_format
-        url << "&values=#{CGI.escape(load_values)}" unless load_values.empty?
-        url
+        command = Groonga::Command::Parser.parse(@gqtp_command)
+        command.to_uri_format
       end
     end
 

  Modified: test/test-executor.rb (+6 -2)
===================================================================
--- test/test-executor.rb    2012-11-27 22:34:44 +0900 (2e9e69d)
+++ test/test-executor.rb    2012-12-05 17:47:17 +0900 (ece56a8)
@@ -113,9 +113,13 @@ class TestExecutor < Test::Unit::TestCase
 EOF
       command = "#{load_command}\n#{load_values}"
       actual_url = convert(command)
+
+      load_values_without_columns =
+        '[["groonga","http://groonga.org/"],["razil","http://razil.jp/"]]'
       arguments = {
         "table" => "Sites",
-        "values" => load_values
+        "columns" => "_key,uri",
+        "values" => load_values_without_columns
       }
       expected_url = build_url("load", arguments)
 
@@ -134,7 +138,7 @@ EOF
 
       arguments = {
         "table" => "Sites",
-        "values" => load_values
+        "values" => '[{"_key":"ruby","uri":"http://ruby-lang.org/"}]'
       }
       expected_url = build_url("load", arguments)
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Zurück zum Archiv-Index