[Groonga-commit] groonga/groonga [master] test: add tests for ">>" and ">>>"

Back to archive index

null+****@clear***** null+****@clear*****
2012年 7月 23日 (月) 14:18:01 JST


Kouhei Sutou	2012-07-23 14:18:01 +0900 (Mon, 23 Jul 2012)

  New Revision: 41ee0771717834ba275d3f6b46f43d68673997c0
  https://github.com/groonga/groonga/commit/41ee0771717834ba275d3f6b46f43d68673997c0

  Log:
    test: add tests for ">>" and ">>>"

  Added files:
    test/function/suite/select/filter/arithmetic_operation/signed_right_shift.expected
    test/function/suite/select/filter/arithmetic_operation/signed_right_shift.test
    test/function/suite/select/filter/arithmetic_operation/unsigned_right_shift.expected
    test/function/suite/select/filter/arithmetic_operation/unsigned_right_shift.test

  Added: test/function/suite/select/filter/arithmetic_operation/signed_right_shift.expected (+55 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/filter/arithmetic_operation/signed_right_shift.expected    2012-07-23 14:18:01 +0900 (042758a)
@@ -0,0 +1,55 @@
+table_create Users TABLE_HASH_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Users score COLUMN_SCALAR Int32
+[[0,0.0,0.0],true]
+load --table Users
+[
+{"_key": "Alice",  "score": -100},
+{"_key": "Bob",    "score":  100},
+{"_key": "Carlos", "score":  -50},
+]
+[[0,0.0,0.0],3]
+select Users --filter 'true' --scorer '_score = score >> 1'   --output_columns _key,score,_score
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        3
+      ],
+      [
+        [
+          "_key",
+          "ShortText"
+        ],
+        [
+          "score",
+          "Int32"
+        ],
+        [
+          "_score",
+          "Int32"
+        ]
+      ],
+      [
+        "Alice",
+        -100,
+        -50
+      ],
+      [
+        "Bob",
+        100,
+        50
+      ],
+      [
+        "Carlos",
+        -50,
+        -25
+      ]
+    ]
+  ]
+]

  Added: test/function/suite/select/filter/arithmetic_operation/signed_right_shift.test (+12 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/filter/arithmetic_operation/signed_right_shift.test    2012-07-23 14:18:01 +0900 (61ebeba)
@@ -0,0 +1,12 @@
+table_create Users TABLE_HASH_KEY ShortText
+column_create Users score COLUMN_SCALAR Int32
+
+load --table Users
+[
+{"_key": "Alice",  "score": -100},
+{"_key": "Bob",    "score":  100},
+{"_key": "Carlos", "score":  -50},
+]
+
+select Users --filter 'true' --scorer '_score = score >> 1' \
+  --output_columns _key,score,_score

  Added: test/function/suite/select/filter/arithmetic_operation/unsigned_right_shift.expected (+55 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/filter/arithmetic_operation/unsigned_right_shift.expected    2012-07-23 14:18:01 +0900 (357d472)
@@ -0,0 +1,55 @@
+table_create Users TABLE_HASH_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Users score COLUMN_SCALAR Int32
+[[0,0.0,0.0],true]
+load --table Users
+[
+{"_key": "Alice",  "score": -100},
+{"_key": "Bob",    "score":  100},
+{"_key": "Carlos", "score":  -50},
+]
+[[0,0.0,0.0],3]
+select Users --filter 'true' --scorer '_score = score >>> 1'   --output_columns _key,score,_score
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        3
+      ],
+      [
+        [
+          "_key",
+          "ShortText"
+        ],
+        [
+          "score",
+          "Int32"
+        ],
+        [
+          "_score",
+          "Int32"
+        ]
+      ],
+      [
+        "Alice",
+        -100,
+        2147483598
+      ],
+      [
+        "Bob",
+        100,
+        50
+      ],
+      [
+        "Carlos",
+        -50,
+        2147483623
+      ]
+    ]
+  ]
+]

  Added: test/function/suite/select/filter/arithmetic_operation/unsigned_right_shift.test (+12 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/filter/arithmetic_operation/unsigned_right_shift.test    2012-07-23 14:18:01 +0900 (5d853dd)
@@ -0,0 +1,12 @@
+table_create Users TABLE_HASH_KEY ShortText
+column_create Users score COLUMN_SCALAR Int32
+
+load --table Users
+[
+{"_key": "Alice",  "score": -100},
+{"_key": "Bob",    "score":  100},
+{"_key": "Carlos", "score":  -50},
+]
+
+select Users --filter 'true' --scorer '_score = score >>> 1' \
+  --output_columns _key,score,_score
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Download 



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