24 #include "../lib/grn-assertions.h"
34 static gchar *tmp_directory;
43 "command-select-query",
50 g_free(tmp_directory);
54 remove_tmp_directory(
void)
56 cut_remove_path(tmp_directory, NULL);
62 const gchar *database_path;
64 remove_tmp_directory();
65 g_mkdir_with_parents(tmp_directory, 0700);
70 database_path = cut_build_path(tmp_directory,
"database.groonga", NULL);
83 remove_tmp_directory();
93 "{\"int64\":344494643000000}\n"
95 cut_assert_equal_string(
97 "[[\"_id\",\"UInt32\"],[\"int64\",\"Int64\"]],"
98 "[1,344494643000000]]]",
99 send_command(
"select Integers --query int64:<=344494643000000"));
109 "{\"int64\":344494643000000}\n"
111 cut_assert_equal_string(
113 "[[\"_id\",\"UInt32\"],[\"int64\",\"Int64\"]],"
114 "[1,344494643000000]]]",
115 send_command(
"select Integers --query int64:<=3.44494643e14"));
128 cut_assert_equal_string(
130 "[[\"_id\",\"UInt32\"],[\"id\",\"IDs\"]],"
141 "{\"_key\":\"mori\"},\n"
142 "{\"_key\":\"morita\"},\n"
143 "{\"_key\":\"mona\"}\n"
145 cut_assert_equal_string(
147 "[[\"_id\",\"UInt32\"],[\"_key\",\"ShortText\"]],"
150 send_command(
"select Users --match_columns _key --query mor*"));
158 "--default_tokenizer TokenBigram");
163 "{\"_key\":\"森 大二郎\"}\n"
165 cut_assert_equal_string(
167 "[[\"_id\",\"UInt32\"],[\"_key\",\"ShortText\"]],"
169 send_command(
"select Users --match_columns _key --query 森 二郎"));
177 "--default_tokenizer TokenBigram");
182 "{\"_key\":\"森 大二郎\"}\n"
184 cut_assert_equal_string(
186 "[[\"_id\",\"UInt32\"],[\"_key\",\"ShortText\"]],"
188 send_command(
"select Users --match_columns _key --query '+森 +二郎'"));
196 "--default_tokenizer TokenBigram");
201 "{\"_key\":\"森 大二郎\"}\n"
203 cut_assert_equal_string(
205 "[[\"_id\",\"UInt32\"],[\"_key\",\"ShortText\"]],"
207 send_command(
"select Users --match_columns _key --query '(+森 +二郎)'"));