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

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Oct 5 13:22:23 JST 2012


Kouhei Sutou	2012-10-05 13:22:23 +0900 (Fri, 05 Oct 2012)

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

  Log:
    Move Cutter tests to grntest tests
    
    Tests for --query_expansion for quoted OR is moved.

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

  Added: test/command/suite/select/query_expansion/scalar/quoted_or.expected (+55 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_expansion/scalar/quoted_or.expected    2012-10-05 13:22:23 +0900 (3f0deff)
@@ -0,0 +1,55 @@
+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 or mroonga!"]
+["Start groonga! Or mroonga!"]
+["Start groonga! OR! mroonga!"]
+]
+[[0,0.0,0.0],3]
+load --table Synonyms
+[
+["_key", "words"],
+["OR", "or"]
+]
+[[0,0.0,0.0],1]
+select --table Memos --query_expansion Synonyms.words   --match_columns content --query '"OR"'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "content",
+          "ShortText"
+        ]
+      ],
+      [
+        1,
+        "Start groonga or mroonga!"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/query_expansion/scalar/quoted_or.test (+25 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_expansion/scalar/quoted_or.test    2012-10-05 13:22:23 +0900 (3850d21)
@@ -0,0 +1,25 @@
+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 or mroonga!"]
+["Start groonga! Or mroonga!"]
+["Start groonga! OR! mroonga!"]
+]
+
+load --table Synonyms
+[
+["_key", "words"],
+["OR", "or"]
+]
+
+select --table Memos --query_expansion Synonyms.words \
+  --match_columns content --query '"OR"'

  Added: test/command/suite/select/query_expansion/vector/quoted_or.expected (+55 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_expansion/vector/quoted_or.expected    2012-10-05 13:22:23 +0900 (7d2cf19)
@@ -0,0 +1,55 @@
+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 or mroonga!"]
+["Start groonga! Or mroonga!"]
+["Start groonga! OR! mroonga!"]
+]
+[[0,0.0,0.0],3]
+load --table Synonyms
+[
+["_key", "words"],
+["OR", ["or"]]
+]
+[[0,0.0,0.0],1]
+select --table Memos --query_expansion Synonyms.words   --match_columns content --query '"OR"'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "content",
+          "ShortText"
+        ]
+      ],
+      [
+        1,
+        "Start groonga or mroonga!"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/query_expansion/vector/quoted_or.test (+25 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query_expansion/vector/quoted_or.test    2012-10-05 13:22:23 +0900 (3082582)
@@ -0,0 +1,25 @@
+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 or mroonga!"]
+["Start groonga! Or mroonga!"]
+["Start groonga! OR! mroonga!"]
+]
+
+load --table Synonyms
+[
+["_key", "words"],
+["OR", ["or"]]
+]
+
+select --table Memos --query_expansion Synonyms.words \
+  --match_columns content --query '"OR"'

  Modified: test/unit/core/test-command-select-query-expansion.c (+0 -24)
===================================================================
--- test/unit/core/test-command-select-query-expansion.c    2012-10-03 10:26:54 +0900 (e5e8864)
+++ test/unit/core/test-command-select-query-expansion.c    2012-10-05 13:22:23 +0900 (c22ebfd)
@@ -23,8 +23,6 @@
 
 #include "../lib/grn-assertions.h"
 
-void data_expand_OR_quoted(void);
-void test_expand_OR_quoted(gconstpointer data);
 void data_expand_column_value(void);
 void test_expand_column_value(gconstpointer data);
 void data_expand_column_value_with_space(void);
@@ -192,28 +190,6 @@ data_scalar_and_vector(void)
 }
 
 void
-data_expand_OR_quoted(void)
-{
-  data_scalar_and_vector();
-}
-
-void
-test_expand_OR_quoted(gconstpointer data)
-{
-  cut_assert_equal_string(
-    "[[[1],"
-     "[[\"_id\",\"UInt32\"],"
-      "[\"_key\",\"Time\"],"
-      "[\"content\",\"Text\"]],"
-     "[10,1316444400.0,\"明日は日本語あるいは中国語を勉強します。\"]]]",
-    send_command(
-      cut_take_printf("select Diaries --sortby _id "
-                      "--match_columns content --query '\"OR\"' "
-                      "--query_expansion Synonyms.%s",
-                      gcut_data_get_string(data, "column-name"))));
-}
-
-void
 data_expand_column_value(void)
 {
   data_scalar_and_vector();
-------------- next part --------------
HTML����������������������������...
Download 



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