[Groonga-commit] groonga/groonga at d81aa60 [master] Add tests for outputting referenced column of scalar reference column

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Jun 12 12:58:43 JST 2013


Kouhei Sutou	2013-06-12 12:58:43 +0900 (Wed, 12 Jun 2013)

  New Revision: d81aa6074b312202b629d745955cc0d9b4618459
  https://github.com/groonga/groonga/commit/d81aa6074b312202b629d745955cc0d9b4618459

  Message:
    Add tests for outputting referenced column of scalar reference column

  Added files:
    test/command/suite/select/output_columns/scalar/reference/column/json.expected
    test/command/suite/select/output_columns/scalar/reference/column/json.test
    test/command/suite/select/output_columns/scalar/reference/column/xml.expected
    test/command/suite/select/output_columns/scalar/reference/column/xml.test

  Added: test/command/suite/select/output_columns/scalar/reference/column/json.expected (+47 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/output_columns/scalar/reference/column/json.expected    2013-06-12 12:58:43 +0900 (1497d66)
@@ -0,0 +1,47 @@
+table_create Users TABLE_HASH_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Users full_name COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+table_create Bookmarks TABLE_HASH_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Bookmarks user COLUMN_SCALAR Users
+[[0,0.0,0.0],true]
+load --table Users
+[
+{"_key": "mori", "full_name": "Daijiro MORI"}
+]
+[[0,0.0,0.0],1]
+load --table Bookmarks
+[
+{"_key": "http://groonga.org/", "user": "mori"}
+]
+[[0,0.0,0.0],1]
+select Bookmarks --output_columns _key,user.full_name
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "_key",
+          "ShortText"
+        ],
+        [
+          "user.full_name",
+          "ShortText"
+        ]
+      ],
+      [
+        "http://groonga.org/",
+        "Daijiro MORI"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/output_columns/scalar/reference/column/json.test (+17 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/output_columns/scalar/reference/column/json.test    2013-06-12 12:58:43 +0900 (779587a)
@@ -0,0 +1,17 @@
+table_create Users TABLE_HASH_KEY ShortText
+column_create Users full_name COLUMN_SCALAR ShortText
+
+table_create Bookmarks TABLE_HASH_KEY ShortText
+column_create Bookmarks user COLUMN_SCALAR Users
+
+load --table Users
+[
+{"_key": "mori", "full_name": "Daijiro MORI"}
+]
+
+load --table Bookmarks
+[
+{"_key": "http://groonga.org/", "user": "mori"}
+]
+
+select Bookmarks --output_columns _key,user.full_name

  Added: test/command/suite/select/output_columns/scalar/reference/column/xml.expected (+34 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/output_columns/scalar/reference/column/xml.expected    2013-06-12 12:58:43 +0900 (3ae82ed)
@@ -0,0 +1,34 @@
+table_create Users TABLE_HASH_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Users full_name COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+table_create Bookmarks TABLE_HASH_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Bookmarks user COLUMN_SCALAR Users
+[[0,0.0,0.0],true]
+load --table Users
+[
+{"_key": "mori", "full_name": "Daijiro MORI"}
+]
+[[0,0.0,0.0],1]
+load --table Bookmarks
+[
+{"_key": "http://groonga.org/", "user": "mori"}
+]
+[[0,0.0,0.0],1]
+select Bookmarks --output_columns _key,user.full_name --output_type xml
+<?xml version="1.0" encoding="utf-8"?>
+<SEGMENTS>
+<SEGMENT>
+<RESULTPAGE>
+<RESULTSET OFFSET="0" LIMIT="1" NHITS="1">
+<HIT NO="1">
+<FIELD NAME="_key">http://groonga.org/</FIELD>
+<FIELD NAME="user.full_name">Daijiro MORI</FIELD>
+</HIT>
+</RESULTSET>
+</RESULTPAGE>
+</SEGMENT>
+</SEGMENTS>
+
+

  Added: test/command/suite/select/output_columns/scalar/reference/column/xml.test (+17 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/output_columns/scalar/reference/column/xml.test    2013-06-12 12:58:43 +0900 (2ce982a)
@@ -0,0 +1,17 @@
+table_create Users TABLE_HASH_KEY ShortText
+column_create Users full_name COLUMN_SCALAR ShortText
+
+table_create Bookmarks TABLE_HASH_KEY ShortText
+column_create Bookmarks user COLUMN_SCALAR Users
+
+load --table Users
+[
+{"_key": "mori", "full_name": "Daijiro MORI"}
+]
+
+load --table Bookmarks
+[
+{"_key": "http://groonga.org/", "user": "mori"}
+]
+
+select Bookmarks --output_columns _key,user.full_name --output_type xml
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index