20 #include <glib/gstdio.h>
22 #include "../lib/grn-assertions.h"
26 #define get(name) grn_ctx_get(context, name, strlen(name))
33 static gchar *tmp_directory;
34 static const gchar *database_path;
50 g_free(tmp_directory);
54 remove_tmp_directory(
void)
56 cut_remove_path(tmp_directory, NULL);
62 remove_tmp_directory();
63 g_mkdir_with_parents(tmp_directory, 0700);
68 database_path = cut_build_path(tmp_directory,
69 "command-table-rename",
81 remove_tmp_directory();
88 "column_create Users name COLUMN_SCALAR ShortText\n"
89 "load --table Users\n"
91 "[\"_key\",\"name\"],\n"
92 "[\"morita\",\"Daijiro MORI\"],\n"
93 "[\"yata\",\"Susumu Yata\"]\n"
102 cut_assert_equal_string(
103 "table_create People TABLE_HASH_KEY ShortText\n"
104 "column_create People name COLUMN_SCALAR ShortText\n"
105 "load --table People\n"
107 "[\"_key\",\"name\"],\n"
108 "[\"morita\",\"Daijiro MORI\"],\n"
109 "[\"yata\",\"Susumu Yata\"]\n"
121 "[table][rename] table name isn't specified",
132 "[table][rename] table isn't found: <nonexistent>",
133 "table_rename nonexistent");
143 "[table][rename] new table name isn't specified: <Users>",
144 "table_rename Users");
154 "[table][rename] isn't table: <Users.name> -> <People>",
155 "table_rename Users.name People");