20 #include <glib/gstdio.h>
22 #include "../lib/grn-assertions.h"
29 static gchar *tmp_directory;
45 g_free(tmp_directory);
49 remove_tmp_directory(
void)
51 cut_remove_path(tmp_directory, NULL);
57 const gchar *database_path;
59 remove_tmp_directory();
60 g_mkdir_with_parents(tmp_directory, 0700);
67 database_path = cut_build_path(tmp_directory,
"database.groonga", NULL);
80 remove_tmp_directory();
93 "{\"name\": \"groonga\" @ \"desc\" \"search engine\"}\n"
96 cut_assert_equal_string(
"ignored invalid char('@') at",
97 g_list_nth_data(log, 0));
98 cut_assert_equal_string(
"{\"name\": \"groonga\" @",
99 g_list_nth_data(log, 1));
100 cut_assert_equal_string(
" ^",
101 g_list_nth_data(log, 2));
113 "{\"info\" \"search engine\"}\n"
116 cut_assert_equal_string(
"neither _key nor _id is assigned",
117 g_list_nth_data(log, 0));
129 "{\"_key\": \"groonga\", \"_id\": 1}\n"
132 cut_assert_equal_string(
"duplicated key columns: _key and _id",
133 g_list_nth_data(log, 0));
145 "{\"_key\": \"groonga\", \"info\" \"search engine\"}\n"
148 cut_assert_equal_string(
"invalid column('info')", g_list_nth_data(log, 0));