null+****@clear*****
null+****@clear*****
2010年 6月 14日 (月) 11:24:41 JST
Kouhei Sutou 2010-06-14 02:24:41 +0000 (Mon, 14 Jun 2010)
New Revision: eb7e18cc8e2009aa9592604de2ee19ce5f664144
Log:
really add a test for Bug #123.
The previous thest is for Bug #304.
Modified files:
test/unit/core/test-load.c
Modified: test/unit/core/test-load.c (+34 -1)
===================================================================
--- test/unit/core/test-load.c 2010-06-14 02:20:07 +0000 (d1ac8d6)
+++ test/unit/core/test-load.c 2010-06-14 02:24:41 +0000 (c26bc2e)
@@ -26,6 +26,8 @@
void test_columns(void);
void attributes_bool(void);
void test_bool(void);
+void attributes_bool_0(void);
+void test_bool_0(void);
static gchar *tmp_directory;
@@ -108,7 +110,7 @@ test_columns(void)
void
attributes_bool(void)
{
- cut_set_attributes("bug", "123",
+ cut_set_attributes("bug", "304",
NULL);
}
@@ -135,3 +137,34 @@ test_bool(void)
"]]",
send_command("select Users"));
}
+
+void
+attributes_bool_0(void)
+{
+ cut_set_attributes("bug", "123",
+ NULL);
+}
+
+void
+test_bool_0(void)
+{
+ assert_send_command("table_create Users TABLE_HASH_KEY ShortText");
+ assert_send_command("column_create Users enabled COLUMN_SCALAR Bool");
+ cut_assert_equal_string(
+ "2",
+ send_command("load --table Users --columns '_key,enabled'\n"
+ "[\n"
+ " [\"mori\",1],\n"
+ " [\"tapo\",0]\n"
+ "]"));
+ cut_assert_equal_string("[[[2],"
+ "["
+ "[\"_id\",\"UInt32\"],"
+ "[\"_key\",\"ShortText\"],"
+ "[\"enabled\",\"Bool\"]"
+ "],"
+ "[1,\"mori\",true],"
+ "[2,\"tapo\",false]"
+ "]]",
+ send_command("select Users"));
+}