null+****@clear*****
null+****@clear*****
2011年 9月 11日 (日) 21:45:13 JST
Kouhei Sutou 2011-09-11 12:45:13 +0000 (Sun, 11 Sep 2011)
New Revision: 1da494b23f8a7170574badcc9206b56db0fa85ff
Log:
[test][query-expansion] add a test for column value.
Modified files:
test/unit/core/test-command-select-query-expansion.c
Modified: test/unit/core/test-command-select-query-expansion.c (+17 -1)
===================================================================
--- test/unit/core/test-command-select-query-expansion.c 2011-09-11 12:23:32 +0000 (7e7cf98)
+++ test/unit/core/test-command-select-query-expansion.c 2011-09-11 12:45:13 +0000 (817215b)
@@ -27,6 +27,7 @@ void test_expand(void);
void test_expand_word_with_space(void);
void test_not_expand_recursively(void);
void test_expand_OR_quoted(void);
+void test_expand_column_value(void);
void test_not_expand_OR(void);
void test_not_expand_OR_at_the_end(void);
void test_not_expand_OR_with_leading_space(void);
@@ -112,7 +113,7 @@ setup_data(void)
"[\"~\", \"補集合\"],\n"
"[\"*\", \"前方一致\"],\n"
"[\"(\", \"かっこ\"],\n"
- "[\")\", \"こっか\"],\n"
+ "[\")\", \"こっか\"]\n"
"]");
}
@@ -209,6 +210,21 @@ test_expand_OR_quoted(void)
}
void
+test_expand_column_value(void)
+{
+ cut_assert_equal_string(
+ "[[[2],"
+ "[[\"_id\",\"UInt32\"],"
+ "[\"_key\",\"Time\"],"
+ "[\"content\",\"Text\"]],"
+ "[3,1315839600.0,\"Start rroonga!\"],"
+ "[9,1316358000.0,\"Learning Ruby and groonga...\"]]]",
+ send_command("select Diaries --sortby _id "
+ "--match_columns content --query 'content:@rroonga' "
+ "--query_expand Synonyms.words"));
+}
+
+void
test_not_expand_OR(void)
{
cut_assert_equal_string(