24 #include "../lib/grn-assertions.h"
29 static gchar *tmp_directory;
38 "command-select-prefix-search",
45 g_free(tmp_directory);
49 remove_tmp_directory(
void)
51 cut_remove_path(tmp_directory, NULL);
58 "column_create Sites url COLUMN_SCALAR ShortText");
61 "column_create Bookmarks site COLUMN_SCALAR Sites");
64 "COLUMN_INDEX Bookmarks site");
72 "[\"_key\", \"url\"],\n"
73 "[\"groonga\", \"http://groonga.org\"],\n"
74 "[\"Senna\", \"http://qwik.jp/senna/FrontPageJ.html\"],\n"
75 "[\"rroonga\", \"http://groonga.rubyforge.org/\"],\n"
76 "[\"ranguba\", \"http://groonga.rubyforge.org/\"]\n"
81 "[\"_key\", \"site\"],\n"
82 "[\"search engine1\", \"Senna\"],\n"
83 "[\"search engine2\", \"groonga\"],\n"
84 "[\"groonga + Ruby\", \"rroonga\"],\n"
85 "[\"search system\", \"ranguba\"]\n"
92 const gchar *database_path;
94 remove_tmp_directory();
95 g_mkdir_with_parents(tmp_directory, 0700);
100 database_path = cut_build_path(tmp_directory,
"database.groonga", NULL);
116 remove_tmp_directory();
122 cut_assert_equal_string(
124 "[[\"_id\",\"UInt32\"],"
125 "[\"_key\",\"ShortText\"],"
126 "[\"site\",\"Sites\"]],"
127 "[3,\"groonga + Ruby\",\"rroonga\"],"
128 "[4,\"search system\",\"ranguba\"]]]",
130 "--query \"site:^r\""));
136 cut_assert_equal_string(
138 "[[\"_id\",\"UInt32\"],"
139 "[\"_key\",\"ShortText\"],"
140 "[\"site\",\"Sites\"]],"
141 "[3,\"groonga + Ruby\",\"rroonga\"],"
142 "[4,\"search system\",\"ranguba\"]]]",
144 "--filter 'site @^ \"r\"'"));