[Groonga-commit] groonga/groonga [master] test: migrate a test from Cutter to grntest style

Back to archive index

null+****@clear***** null+****@clear*****
2012年 4月 19日 (木) 16:09:27 JST


khayashi	2012-04-19 16:09:27 +0900 (Thu, 19 Apr 2012)

  New Revision: 653edaaf1f79592d1779816c2be6951ada2b9d01

  Log:
    test: migrate a test from Cutter to grntest style
    
    The test checks the output of select command is valid COLUMN_VECTOR
    WGS84GeoPoint value.

  Added files:
    test/function/suite/select/output/vector-geo-point.expected
    test/function/suite/select/output/vector-geo-point.test
  Modified files:
    test/unit/core/test-command-select.c

  Added: test/function/suite/select/output/vector-geo-point.expected (+47 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/output/vector-geo-point.expected    2012-04-19 16:09:27 +0900 (d2ea1e8)
@@ -0,0 +1,47 @@
+table_create Shops TABLE_HASH_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Shops places COLUMN_VECTOR WGS84GeoPoint
+[[0,0.0,0.0],true]
+load --table Shops
+[
+["_key","places"],
+["daruma",["130094061x505025099","130185500x505009000"]]
+]
+[[0,0.0,0.0],1]
+select Shops
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "_key",
+          "ShortText"
+        ],
+        [
+          "places",
+          "WGS84GeoPoint"
+        ]
+      ],
+      [
+        1,
+        "daruma",
+        [
+          "130094061x505025099",
+          "130185500x505009000"
+        ]
+      ]
+    ]
+  ]
+]

  Added: test/function/suite/select/output/vector-geo-point.test (+10 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/output/vector-geo-point.test    2012-04-19 16:09:27 +0900 (3f8f99a)
@@ -0,0 +1,10 @@
+table_create Shops TABLE_HASH_KEY ShortText
+column_create Shops places COLUMN_VECTOR WGS84GeoPoint
+
+load --table Shops
+[
+["_key","places"],
+["daruma",["130094061x505025099","130185500x505009000"]]
+]
+
+select Shops

  Modified: test/unit/core/test-command-select.c (+0 -26)
===================================================================
--- test/unit/core/test-command-select.c    2012-04-19 10:13:11 +0900 (def9c88)
+++ test/unit/core/test-command-select.c    2012-04-19 16:09:27 +0900 (65ec522)
@@ -24,7 +24,6 @@
 
 #include "../lib/grn-assertions.h"
 
-void test_vector_geo_point(void);
 void test_vector_geo_point_with_query(void);
 void test_unmatched_output_columns(void);
 void test_vector_int32(void);
@@ -101,31 +100,6 @@ cut_teardown(void)
 }
 
 void
-test_vector_geo_point(void)
-{
-  assert_send_command("table_create Shops TABLE_HASH_KEY ShortText");
-  assert_send_command("column_create Shops places COLUMN_VECTOR WGS84GeoPoint");
-  assert_send_command("load "
-                      "'["
-                      "[\"_key\",\"places\"],"
-                      "[\"daruma\","
-                      "[\"130094061x505025099\",\"130185500x505009000\"]]"
-                      "]' "
-                      "Shops");
-  cut_assert_equal_string("[["
-                          "[1],"
-                          "["
-                          "[\"_id\",\"UInt32\"],"
-                          "[\"_key\",\"ShortText\"],"
-                          "[\"places\",\"WGS84GeoPoint\"]"
-                          "],"
-                          "[1,\"daruma\","
-                          "[\"130094061x505025099\",\"130185500x505009000\"]]"
-                          "]]",
-                          send_command("select Shops"));
-}
-
-void
 test_vector_geo_point_with_query(void)
 {
   assert_send_command("table_create Shops TABLE_HASH_KEY ShortText");




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