[Groonga-commit] groonga/groonga [master] Fixed some tests following new command behavior.

Back to archive index

null+****@clear***** null+****@clear*****
2010年 7月 12日 (月) 22:07:14 JST


Daijiro MORI	2010-07-12 13:07:14 +0000 (Mon, 12 Jul 2010)

  New Revision: 53ed73eec41094c2c0f92a998aba581329fc887d

  Log:
    Fixed some tests following new command behavior.

  Modified files:
    test/unit/core/test-command-cache-limit.c
    test/unit/core/test-command-load.c
    test/unit/core/test-command-select-sort.c

  Modified: test/unit/core/test-command-cache-limit.c (+5 -5)
===================================================================
--- test/unit/core/test-command-cache-limit.c    2010-07-12 12:22:24 +0000 (22007da)
+++ test/unit/core/test-command-cache-limit.c    2010-07-12 13:07:14 +0000 (01e9829)
@@ -89,14 +89,14 @@ cut_teardown(void)
 void
 test_get(void)
 {
-  cut_assert_equal_string("[100]", send_command("cache_limit"));
+  cut_assert_equal_string("100", send_command("cache_limit"));
 }
 
 void
 test_set(void)
 {
-  cut_assert_equal_string("[100]", send_command("cache_limit --max 1000"));
-  cut_assert_equal_string("[1000]", send_command("cache_limit"));
+  cut_assert_equal_string("100", send_command("cache_limit --max 1000"));
+  cut_assert_equal_string("1000", send_command("cache_limit"));
 }
 
 void
@@ -107,7 +107,7 @@ test_set_invalid_minus(void)
     GRN_INVALID_ARGUMENT,
     "max value is invalid unsigned integer format: <-1>",
     "cache_limit --max -1");
-  cut_assert_equal_string("[100]", send_command("cache_limit"));
+  cut_assert_equal_string("100", send_command("cache_limit"));
 }
 
 void
@@ -118,5 +118,5 @@ test_set_invalid_string(void)
     GRN_INVALID_ARGUMENT,
     "max value is invalid unsigned integer format: <LIMIT>",
     "cache_limit --max LIMIT");
-  cut_assert_equal_string("[100]", send_command("cache_limit"));
+  cut_assert_equal_string("100", send_command("cache_limit"));
 }

  Modified: test/unit/core/test-command-load.c (+3 -3)
===================================================================
--- test/unit/core/test-command-load.c    2010-07-12 12:22:24 +0000 (8967a71)
+++ test/unit/core/test-command-load.c    2010-07-12 13:07:14 +0000 (1a3b21a)
@@ -90,7 +90,7 @@ test_columns(void)
   assert_send_command("column_create Users name COLUMN_SCALAR ShortText");
   assert_send_command("column_create Users desc COLUMN_SCALAR ShortText");
   cut_assert_equal_string(
-    "[2]",
+    "2",
     send_command("load --table Users --columns '_key,name,desc'\n"
                  "[\n"
                  "  [\"mori\", \"モリ\", \"タポ\"],\n"
@@ -157,7 +157,7 @@ test_bool(gconstpointer data)
 {
   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]",
+  cut_assert_equal_string("2",
                           send_command(gcut_data_get_string(data,
                                                             "load-command")));
   cut_assert_equal_string("[[[2],"
@@ -178,7 +178,7 @@ test_int32_key(void)
   assert_send_command("table_create Students TABLE_HASH_KEY Int32");
   assert_send_command("column_create Students name COLUMN_SCALAR ShortText");
   cut_assert_equal_string(
-    "[1]",
+    "1",
     send_command("load --table Students\n"
                  "[{\"_key\": 1, \"name\": \"morita\"}]"));
   cut_assert_equal_string("[[[1],"

  Modified: test/unit/core/test-command-select-sort.c (+2 -31)
===================================================================
--- test/unit/core/test-command-select-sort.c    2010-07-12 12:22:24 +0000 (e40d0fb)
+++ test/unit/core/test-command-select-sort.c    2010-07-12 13:07:14 +0000 (fec9581)
@@ -192,11 +192,7 @@ void
 test_score_without_query(void)
 {
   cut_assert_equal_string(
-      "[[[3],"
-       "[[\"_key\",\"ShortText\"]],"
-       "[\"2ch.net\"],"
-       "[\"groonga.org\"],"
-       "[\"qwik.jp/senna/FrontPageJ.html\"]]]",
+      "[]",
       send_command("select Sites "
                    "--sortby \"_score\" "
                    "--output_columns \"_key\""));
@@ -206,32 +202,7 @@ void
 test_score_drilldown_without_query(void)
 {
   cut_assert_equal_string(
-      "[[[5],"
-       "[[\"site._key\",\"ShortText\"],"
-        "[\"user._key\",\"ShortText\"]],"
-       "[\"groonga.org\",\"morita\"],"
-       "[\"groonga.org\",\"gunyara-kun\"],"
-       "[\"groonga.org\",\"yu\"],"
-       "[\"2ch.net\",\"gunyara-kun\"],"
-       "[\"2ch.net\",\"yu\"]],"
-       "[[2],"
-        "[[\"_key\",\"ShortText\"],"
-         "[\"_nsubrecs\",\"Int32\"]],"
-        "[\"2ch.net\",2],"
-        "[\"groonga.org\",3]],"
-       "[[3],"
-        "[[\"_key\",\"ShortText\"],"
-         "[\"_nsubrecs\",\"Int32\"]],"
-        "[\"gunyara-kun\",2],"
-        "[\"morita\",1],"
-        "[\"yu\",2]],"
-       "[[4],"
-         "[[\"_key\",\"Int32\"],"
-          "[\"_nsubrecs\",\"Int32\"]],"
-        "[0,1],"
-        "[10,1],"
-        "[50,1],"
-        "[100,2]]]",
+      "[]",
       send_command("select Bookmarks "
                    "--sortby \"_score\" "
                    "--output_columns \"site._key user._key\" "




Groonga-commit メーリングリストの案内
Back to archive index