[Groonga-commit] droonga/fluent-plugin-droonga at 4ad3aff [master] Test: add assertions for non-string and missing offset/limit for "select" command

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Nov 21 12:12:37 JST 2013


YUKI Hiroshi	2013-11-21 12:12:37 +0900 (Thu, 21 Nov 2013)

  New Revision: 4ad3affa9db0e3e4b9d9da233902eb023ad82c9d
  https://github.com/droonga/fluent-plugin-droonga/commit/4ad3affa9db0e3e4b9d9da233902eb023ad82c9d

  Message:
    Test: add assertions for non-string and missing offset/limit for "select" command

  Modified files:
    test/unit/plugin/adapter/groonga/test_select.rb

  Modified: test/unit/plugin/adapter/groonga/test_select.rb (+18 -2)
===================================================================
--- test/unit/plugin/adapter/groonga/test_select.rb    2013-11-21 12:09:45 +0900 (e2ac0c2)
+++ test/unit/plugin/adapter/groonga/test_select.rb    2013-11-21 12:12:37 +0900 (c461c36)
@@ -151,8 +151,8 @@ class AdapterGroongaSelectTest < Test::Unit::TestCase
         select_request = {
           "table"          => "EmptyTable",
           "output_columns" => "_id",
-          "offset"         => offset,
         }
+        select_request["offset"] = offset unless offset.nil?
 
         expected_search_request = {
           "queries" => {
@@ -183,6 +183,14 @@ class AdapterGroongaSelectTest < Test::Unit::TestCase
       def test_large
         assert_offset(100, "100")
       end
+
+      def test_integer
+        assert_offset(100, 100)
+      end
+
+      def test_default
+        assert_offset(0, nil)
+      end
     end
 
     class LimitTest < self
@@ -190,8 +198,8 @@ class AdapterGroongaSelectTest < Test::Unit::TestCase
         select_request = {
           "table"          => "EmptyTable",
           "output_columns" => "_id",
-          "limit"          => limit,
         }
+        select_request["limit"] = limit unless limit.nil?
 
         expected_search_request = {
           "queries" => {
@@ -226,6 +234,14 @@ class AdapterGroongaSelectTest < Test::Unit::TestCase
       def test_negative
         assert_limit(-1, "-1")
       end
+
+      def test_integer
+        assert_limit(100, 100)
+      end
+
+      def test_default
+        assert_limit(10, nil)
+      end
     end
   end
 
-------------- next part --------------
HTML����������������������������...
Download 



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