null+****@clear*****
null+****@clear*****
2010年 8月 13日 (金) 13:58:41 JST
Kouhei Sutou 2010-08-13 04:58:41 +0000 (Fri, 13 Aug 2010)
New Revision: fe0d0caff39d9bc3f7ae86f375eaf787122d6dc1
Log:
add a test boolean literal in filter. #402
Modified files:
test/unit/core/test-command-select.c
Modified: test/unit/core/test-command-select.c (+21 -0)
===================================================================
--- test/unit/core/test-command-select.c 2010-08-13 03:39:26 +0000 (85447ba)
+++ test/unit/core/test-command-select.c 2010-08-13 04:58:41 +0000 (4378a2d)
@@ -36,6 +36,7 @@ void test_contradiction(void);
void test_filter_null(void);
void test_bigram_split_symbol_tokenizer(void);
void test_nonexistent_table(void);
+void test_boolean(void);
static gchar *tmp_directory;
@@ -421,3 +422,23 @@ test_nonexistent_table(void)
"invalid table name: nonexistent",
context);
}
+
+void
+test_boolean(void)
+{
+ assert_send_command("table_create Blogs TABLE_HASH_KEY ShortText");
+ assert_send_command("column_create Blogs public COLUMN_SCALAR Bool");
+
+ assert_send_command("load --table Blogs --columns '_key, public' \n"
+ "[\n"
+ " [\"groonga 1.0\", true],\n"
+ " [\"groonga 2.0\", false]\n"
+ "]");
+ cut_assert_equal_string("[[[1],"
+ "[[\"_key\",\"ShortText\"],"
+ "[\"public\",\"Bool\"]],"
+ "[\"groonga 1.0\",true]]]",
+ send_command("select Blogs "
+ "--output_columns _key,public "
+ "--filter public==true"));
+}