null+****@clear*****
null+****@clear*****
2011年 8月 17日 (水) 09:34:51 JST
Kouhei Sutou 2011-08-17 00:34:51 +0000 (Wed, 17 Aug 2011)
New Revision: 24d882809ecc99736545c855152c82f6a7b4341e
Log:
[test] add a test about vector reference column. refs #1051
This is a test for 56837f505a47436ace61f102784f339036d0e4ae.
Modified files:
test/unit/core/test-command-load.c
Modified: test/unit/core/test-command-load.c (+23 -0)
===================================================================
--- test/unit/core/test-command-load.c 2011-08-16 10:51:12 +0000 (8ec6f40)
+++ test/unit/core/test-command-load.c 2011-08-17 00:34:51 +0000 (1691be4)
@@ -41,6 +41,7 @@ void test_nonexistent_table_name(void);
void test_invalid_table_name(void);
void data_each(void);
void test_each(gconstpointer data);
+void test_vector_reference_column(void);
static gchar *tmp_directory;
static const gchar *database_path;
@@ -557,3 +558,25 @@ test_each(gconstpointer data)
send_command("select Users"));
}
+void
+test_vector_reference_column(void)
+{
+ assert_send_command("table_create Tags TABLE_HASH_KEY ShortText "
+ "--default_tokenizer TokenDelimit");
+ assert_send_command("table_create Users TABLE_HASH_KEY ShortText");
+ assert_send_command("column_create Users tags COLUMN_VECTOR Tags");
+ cut_assert_equal_string(
+ "1",
+ send_command(
+ "load "
+ "--table Users "
+ "--values '[{\"_key\": \"mori\", \"tags\": \"groonga search engine\"}]'"));
+ cut_assert_equal_string(
+ "[[[1],"
+ "[[\"_id\",\"UInt32\"],"
+ "[\"_key\",\"ShortText\"],"
+ "[\"tags\",\"Tags\"]],"
+ "[1,\"mori\",[\"groonga\",\"search\",\"engine\"]]]]",
+ send_command("select Users"));
+}
+