null+****@clear*****
null+****@clear*****
2010年 8月 25日 (水) 22:15:07 JST
Kouhei Sutou 2010-08-25 13:15:07 +0000 (Wed, 25 Aug 2010)
New Revision: b5b9605a2f7045a68ef818751d470bbba34eb6ce
Log:
add a test for equal query with index.
Modified files:
test/unit/core/test-command-select.c
Modified: test/unit/core/test-command-select.c (+25 -0)
===================================================================
--- test/unit/core/test-command-select.c 2010-08-25 12:52:56 +0000 (5a28f1f)
+++ test/unit/core/test-command-select.c 2010-08-25 13:15:07 +0000 (0d78e46)
@@ -38,6 +38,7 @@ void test_filter_null(void);
void test_bigram_split_symbol_tokenizer(void);
void test_nonexistent_table(void);
void test_boolean(void);
+void test_equal_index(void);
static gchar *tmp_directory;
@@ -477,3 +478,27 @@ test_boolean(void)
"--output_columns _key,public "
"--filter public==true"));
}
+
+void
+test_equal_index(void)
+{
+ assert_send_command("table_create Blogs TABLE_HASH_KEY ShortText");
+ assert_send_command("table_create Titles TABLE_HASH_KEY ShortText");
+ assert_send_command("column_create Blogs title COLUMN_SCALAR Titles");
+ assert_send_command("column_create Titles Blogs_title "
+ "COLUMN_INDEX Blogs title");
+
+ assert_send_command("load --table Blogs --columns '_key, title' \n"
+ "[\n"
+ " [\"groonga-1-0\", \"groonga 1.0 release!\"],\n"
+ " [\"groonga-2-0\", \"groonga 2.0 release!\"]\n"
+ "]");
+ cut_assert_equal_string(
+ "[[[1],"
+ "[[\"_key\",\"ShortText\"],"
+ "[\"title\",\"Titles\"]],"
+ "[\"groonga-1-0\",\"groonga 1.0 release!\"]]]",
+ send_command("select Blogs "
+ "--output_columns _key,title "
+ "--filter 'title == \"groonga 1.0 release!\"'"));
+}