[Groonga-commit] groonga/groonga [master] Move Cutter tests to grntest tests

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Oct 9 11:49:54 JST 2012


Kouhei Sutou	2012-10-09 11:49:54 +0900 (Tue, 09 Oct 2012)

  New Revision: c8d6d3fd174520c86cce6d424802316bf36aa768
  https://github.com/groonga/groonga/commit/c8d6d3fd174520c86cce6d424802316bf36aa768

  Log:
    Move Cutter tests to grntest tests
    
    Tests for --query_expansion with not registered synonym --query is
    moved.

  Added files:
    test/command/suite/select/query_expansion/scalar/not_registered_synonym.expected
    test/command/suite/select/query_expansion/scalar/not_registered_synonym.test
    test/command/suite/select/query_expansion/vector/not_registered_synonym.expected
    test/command/suite/select/query_expansion/vector/not_registered_synonym.test
  Modified files:
    test/unit/core/test-command-select-query-expansion.c

  Added: test/command/suite/select/query_expansion/scalar/not_registered_synonym.expected (+56 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_expansion/scalar/not_registered_synonym.expected    2012-10-09 11:49:54 +0900 (80363c8)
@@ -0,0 +1,56 @@
+table_create Memos TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Memos content COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
+[[0,0.0,0.0],true]
+column_create Lexicon diary_content COLUMN_INDEX|WITH_POSITION Memos content
+[[0,0.0,0.0],true]
+table_create Synonyms TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Synonyms words COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+load --table Memos
+[
+["content"],
+["Start groonga!"],
+["Start mroonga!"],
+["Start rroonga!"],
+["Start Ruby!"]
+]
+[[0,0.0,0.0],4]
+load --table Synonyms
+[
+["_key", "words"],
+["rroonga", "Ruby OR groonga"]
+]
+[[0,0.0,0.0],1]
+select --table Memos --query_expansion Synonyms.words   --match_columns content --query 'Ruby'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "content",
+          "ShortText"
+        ]
+      ],
+      [
+        4,
+        "Start Ruby!"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/query_expansion/scalar/not_registered_synonym.test (+26 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_expansion/scalar/not_registered_synonym.test    2012-10-09 11:49:54 +0900 (03f57ba)
@@ -0,0 +1,26 @@
+table_create Memos TABLE_NO_KEY
+column_create Memos content COLUMN_SCALAR ShortText
+
+table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
+column_create Lexicon diary_content COLUMN_INDEX|WITH_POSITION Memos content
+
+table_create Synonyms TABLE_PAT_KEY ShortText
+column_create Synonyms words COLUMN_SCALAR ShortText
+
+load --table Memos
+[
+["content"],
+["Start groonga!"],
+["Start mroonga!"],
+["Start rroonga!"],
+["Start Ruby!"]
+]
+
+load --table Synonyms
+[
+["_key", "words"],
+["rroonga", "Ruby OR groonga"]
+]
+
+select --table Memos --query_expansion Synonyms.words \
+  --match_columns content --query 'Ruby'

  Added: test/command/suite/select/query_expansion/vector/not_registered_synonym.expected (+56 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_expansion/vector/not_registered_synonym.expected    2012-10-09 11:49:54 +0900 (8c22b7b)
@@ -0,0 +1,56 @@
+table_create Memos TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Memos content COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
+[[0,0.0,0.0],true]
+column_create Lexicon diary_content COLUMN_INDEX|WITH_POSITION Memos content
+[[0,0.0,0.0],true]
+table_create Synonyms TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Synonyms words COLUMN_VECTOR ShortText
+[[0,0.0,0.0],true]
+load --table Memos
+[
+["content"],
+["Start groonga!"],
+["Start mroonga!"],
+["Start rroonga!"],
+["Start Ruby!"]
+]
+[[0,0.0,0.0],4]
+load --table Synonyms
+[
+["_key", "words"],
+["rroonga", ["Ruby", "groonga"]]
+]
+[[0,0.0,0.0],1]
+select --table Memos --query_expansion Synonyms.words   --match_columns content --query 'Ruby'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "content",
+          "ShortText"
+        ]
+      ],
+      [
+        4,
+        "Start Ruby!"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/query_expansion/vector/not_registered_synonym.test (+26 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_expansion/vector/not_registered_synonym.test    2012-10-09 11:49:54 +0900 (b96fc2e)
@@ -0,0 +1,26 @@
+table_create Memos TABLE_NO_KEY
+column_create Memos content COLUMN_SCALAR ShortText
+
+table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
+column_create Lexicon diary_content COLUMN_INDEX|WITH_POSITION Memos content
+
+table_create Synonyms TABLE_PAT_KEY ShortText
+column_create Synonyms words COLUMN_VECTOR ShortText
+
+load --table Memos
+[
+["content"],
+["Start groonga!"],
+["Start mroonga!"],
+["Start rroonga!"],
+["Start Ruby!"]
+]
+
+load --table Synonyms
+[
+["_key", "words"],
+["rroonga", ["Ruby", "groonga"]]
+]
+
+select --table Memos --query_expansion Synonyms.words \
+  --match_columns content --query 'Ruby'

  Modified: test/unit/core/test-command-select-query-expansion.c (+0 -22)
===================================================================
--- test/unit/core/test-command-select-query-expansion.c    2012-10-09 11:43:33 +0900 (79e31b6)
+++ test/unit/core/test-command-select-query-expansion.c    2012-10-09 11:49:54 +0900 (0f662ba)
@@ -186,28 +186,6 @@ data_scalar_and_vector(void)
 }
 
 void
-data_no_expand(void)
-{
-  data_scalar_and_vector();
-}
-
-void
-test_no_expand(gconstpointer data)
-{
-  cut_assert_equal_string(
-    "[[[2],"
-     "[[\"_id\",\"UInt32\"],"
-      "[\"_key\",\"Time\"],"
-      "[\"content\",\"Text\"]],"
-     "[4,1315926000.0,\"Start Ruby!\"],"
-     "[9,1316358000.0,\"Learning Ruby and groonga...\"]]]",
-    send_command(
-      cut_take_printf("select Diaries --match_columns content --query Ruby "
-                      "--query_expansion Synonyms.%s",
-                      gcut_data_get_string(data, "column-name"))));
-}
-
-void
 data_no_expand_word_with_space(void)
 {
   data_scalar_and_vector();
-------------- next part --------------
HTML����������������������������...
Download 



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