[Groonga-commit] droonga/droonga-engine at 66fb06f [master] Add more tests for parsing of valid strings

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Apr 30 10:18:17 JST 2015


YUKI Hiroshi	2015-04-30 10:18:17 +0900 (Thu, 30 Apr 2015)

  New Revision: 66fb06fbc57af88a05a20d97a4c745febf8ff46a
  https://github.com/droonga/droonga-engine/commit/66fb06fbc57af88a05a20d97a4c745febf8ff46a

  Message:
    Add more tests for parsing of valid strings

  Modified files:
    test/unit/test_node_name.rb

  Modified: test/unit/test_node_name.rb (+15 -3)
===================================================================
--- test/unit/test_node_name.rb    2015-04-30 10:18:07 +0900 (4c13e2a)
+++ test/unit/test_node_name.rb    2015-04-30 10:18:17 +0900 (361cbb4)
@@ -44,9 +44,21 @@ class NodeNameTest < Test::Unit::TestCase
       Droonga::NodeName.parse(string)
     end
 
-    def test_valid_string
-      assert_equal(node_name("192.168.0.1", 2929, "droonga"),
-                   parse("192.168.0.1:2929/droonga"))
+    data(:ip_address => {
+           :input => "192.168.0.1:2929/droonga",
+           :host  => "192.168.0.1",
+           :port  => 2929,
+           :tag   => "droonga",
+         },
+         :host_name => {
+           :input => "node29:2929/droonga",
+           :host  => "node29",
+           :port  => 2929,
+           :tag   => "droonga",
+         })
+    def test_valid_string(data)
+      assert_equal(node_name(data[:host], data[:port], data[:tag]),
+                   parse(data[:input]))
     end
 
     def test_instance
-------------- next part --------------
HTML����������������������������...
Download 



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