null+****@clear*****
null+****@clear*****
2010年 12月 24日 (金) 14:03:17 JST
Kouhei Sutou 2010-12-24 05:03:17 +0000 (Fri, 24 Dec 2010)
New Revision: 6e4f7e914511a8f51b9679158466ffd75320a635
Log:
add more test for NO_KEY delete. #794
Modified files:
test/unit/core/test-command-delete.c
Modified: test/unit/core/test-command-delete.c (+22 -0)
===================================================================
--- test/unit/core/test-command-delete.c 2010-12-23 02:59:14 +0000 (8507bf9)
+++ test/unit/core/test-command-delete.c 2010-12-24 05:03:17 +0000 (3e486b7)
@@ -29,6 +29,7 @@ void test_referenced_record(void);
void test_uint64(void);
void test_last_token(void);
void test_no_key_twice(void);
+void test_no_key_by_id(void);
static gchar *tmp_directory;
@@ -212,3 +213,24 @@ test_no_key_twice(void)
"[3,\"Cutter\"]]]",
send_command("select Sites"));
}
+
+void
+test_no_key_by_id(void)
+{
+ assert_send_command("table_create Sites TABLE_NO_KEY");
+ assert_send_command("column_create Sites title COLUMN_SCALAR ShortText");
+ cut_assert_equal_string("3",
+ send_command("load --table Sites\n"
+ "[\n"
+ "{\"title\": \"groonga\"},\n"
+ "{\"title\": \"Ruby\"},\n"
+ "{\"title\": \"Cutter\"}\n"
+ "]"));
+ assert_send_command("delete Sites --id 2");
+ cut_assert_equal_string("[[[2],"
+ "[[\"_id\",\"UInt32\"],"
+ "[\"title\",\"ShortText\"]],"
+ "[1,\"groonga\"],"
+ "[3,\"Cutter\"]]]",
+ send_command("select Sites"));
+}