[Groonga-commit] groonga/groonga [master] [test] added a test for table_create --default_tokenizer.

Back to archive index

null+****@clear***** null+****@clear*****
2012年 2月 10日 (金) 15:56:26 JST


Kouhei Sutou	2012-02-10 15:56:26 +0900 (Fri, 10 Feb 2012)

  New Revision: d4896b9b6be0390aa715a6e8a327da979cafee6f

  Log:
    [test] added a test for table_create --default_tokenizer.

  Modified files:
    test/unit/core/test-command-table-create.c

  Modified: test/unit/core/test-command-table-create.c (+14 -0)
===================================================================
--- test/unit/core/test-command-table-create.c    2012-02-10 15:55:53 +0900 (9890f09)
+++ test/unit/core/test-command-table-create.c    2012-02-10 15:56:26 +0900 (4f1e772)
@@ -27,6 +27,7 @@ void test_hash_key(void);
 void test_pat_key(void);
 void test_dat_key(void);
 void test_no_key(void);
+void test_default_tokenizer(void);
 
 void test_invalid_name(void);
 
@@ -123,6 +124,19 @@ test_no_key(void)
 }
 
 void
+test_default_tokenizer(void)
+{
+  grn_obj *tokenizer;
+  assert_send_command("table_create Users TABLE_PAT_KEY ShortText "
+                      "--default_tokenizer TokenBigram");
+  grn_test_assert_users_exist();
+  tokenizer = grn_obj_get_info(context, users, GRN_INFO_DEFAULT_TOKENIZER, NULL);
+  grn_test_assert_equal_id(context,
+                           GRN_DB_BIGRAM,
+                           grn_obj_id(context, tokenizer));
+}
+
+void
 test_invalid_name(void)
 {
   grn_test_assert_send_command_error(




Groonga-commit メーリングリストの案内
Back to archive index