[Groonga-commit] groonga/groonga-command at 66edcbe [fix-travis-ci-error] Fix a bug that the second or later in a multiple lines chunk are ignored

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Jan 13 17:20:56 JST 2016


Kouhei Sutou	2013-09-18 15:05:44 +0900 (Wed, 18 Sep 2013)

  New Revision: 66edcbe9fe71f9300322c0c78323591b1ba68a87
  https://github.com/groonga/groonga-command/commit/66edcbe9fe71f9300322c0c78323591b1ba68a87

  Message:
    Fix a bug that the second or later in a multiple lines chunk are ignored

  Modified files:
    lib/groonga/command/parser.rb
    test/test-parser.rb

  Modified: lib/groonga/command/parser.rb (+1 -1)
===================================================================
--- lib/groonga/command/parser.rb    2013-09-13 11:18:23 +0900 (858bae6)
+++ lib/groonga/command/parser.rb    2013-09-18 15:05:44 +0900 (656cf97)
@@ -380,7 +380,7 @@ module Groonga
           end
         else
           on_command(@command)
-          reset
+          @command = nil
         end
       end
 

  Modified: test/test-parser.rb (+18 -0)
===================================================================
--- test/test-parser.rb    2013-09-13 11:18:23 +0900 (5992116)
+++ test/test-parser.rb    2013-09-18 15:05:44 +0900 (015d5dd)
@@ -113,6 +113,24 @@ class ParserTest < Test::Unit::TestCase
           @parser << "status\n"
           assert_equal("status", parsed_command.name)
         end
+
+        def test_multi_lines
+          parsed_commands = []
+          @parser.on_command do |command|
+            parsed_commands << command
+          end
+
+          @parser << <<-COMMAND_LIST.chomp
+table_list
+status
+          COMMAND_LIST
+          assert_equal(["table_list"],
+                       parsed_commands.collect(&:name))
+
+          @parser.finish
+          assert_equal(["table_list", "status"],
+                       parsed_commands.collect(&:name))
+        end
       end
 
       class LoadTest < self
-------------- next part --------------
HTML����������������������������...
Download 



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