null+****@clear*****
null+****@clear*****
2012年 6月 16日 (土) 12:15:38 JST
Kouhei Sutou 2012-06-16 12:15:38 +0900 (Sat, 16 Jun 2012)
New Revision: fcf389dab501b29815c9986e8e8f340d026351c1
https://github.com/groonga/groonga/commit/fcf389dab501b29815c9986e8e8f340d026351c1
Log:
test: add tests for prefix search in query syntax
Added files:
test/function/suite/select/query/prefix_search/double_array_trie.expected
test/function/suite/select/query/prefix_search/double_array_trie.test
test/function/suite/select/query/prefix_search/hash.expected
test/function/suite/select/query/prefix_search/hash.test
test/function/suite/select/query/prefix_search/patricia_trie.expected
test/function/suite/select/query/prefix_search/patricia_trie.test
Added: test/function/suite/select/query/prefix_search/double_array_trie.expected (+43 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/query/prefix_search/double_array_trie.expected 2012-06-16 12:15:38 +0900 (6305d53)
@@ -0,0 +1,43 @@
+table_create Names TABLE_DAT_KEY ShortText
+[[0,0.0,0.0],true]
+load --table Names
+[
+{"_key":"ひろゆき"},
+{"_key":"まろゆき"},
+{"_key":"ひろあき"},
+{"_key":"ゆきひろ"}
+]
+[[0,0.0,0.0],4]
+select --table Names --query _key:^ひろ
+[
+ [
+ 0,
+ 0.0,
+ 0.0
+ ],
+ [
+ [
+ [
+ 2
+ ],
+ [
+ [
+ "_id",
+ "UInt32"
+ ],
+ [
+ "_key",
+ "ShortText"
+ ]
+ ],
+ [
+ 3,
+ "ひろあき"
+ ],
+ [
+ 1,
+ "ひろゆき"
+ ]
+ ]
+ ]
+]
Added: test/function/suite/select/query/prefix_search/double_array_trie.test (+9 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/query/prefix_search/double_array_trie.test 2012-06-16 12:15:38 +0900 (a36e18d)
@@ -0,0 +1,9 @@
+table_create Names TABLE_DAT_KEY ShortText
+load --table Names
+[
+{"_key":"ひろゆき"},
+{"_key":"まろゆき"},
+{"_key":"ひろあき"},
+{"_key":"ゆきひろ"}
+]
+select --table Names --query _key:^ひろ
Added: test/function/suite/select/query/prefix_search/hash.expected (+43 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/query/prefix_search/hash.expected 2012-06-16 12:15:38 +0900 (6c3ffc3)
@@ -0,0 +1,43 @@
+table_create Names TABLE_HASH_KEY ShortText
+[[0,0.0,0.0],true]
+load --table Names
+[
+{"_key":"ひろゆき"},
+{"_key":"まろゆき"},
+{"_key":"ひろあき"},
+{"_key":"ゆきひろ"}
+]
+[[0,0.0,0.0],4]
+select --table Names --query _key:^ひろ
+[
+ [
+ 0,
+ 0.0,
+ 0.0
+ ],
+ [
+ [
+ [
+ 2
+ ],
+ [
+ [
+ "_id",
+ "UInt32"
+ ],
+ [
+ "_key",
+ "ShortText"
+ ]
+ ],
+ [
+ 1,
+ "ひろゆき"
+ ],
+ [
+ 3,
+ "ひろあき"
+ ]
+ ]
+ ]
+]
Added: test/function/suite/select/query/prefix_search/hash.test (+9 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/query/prefix_search/hash.test 2012-06-16 12:15:38 +0900 (a49b926)
@@ -0,0 +1,9 @@
+table_create Names TABLE_HASH_KEY ShortText
+load --table Names
+[
+{"_key":"ひろゆき"},
+{"_key":"まろゆき"},
+{"_key":"ひろあき"},
+{"_key":"ゆきひろ"}
+]
+select --table Names --query _key:^ひろ
Added: test/function/suite/select/query/prefix_search/patricia_trie.expected (+43 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/query/prefix_search/patricia_trie.expected 2012-06-16 12:15:38 +0900 (3901b20)
@@ -0,0 +1,43 @@
+table_create Names TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+load --table Names
+[
+{"_key":"ひろゆき"},
+{"_key":"まろゆき"},
+{"_key":"ひろあき"},
+{"_key":"ゆきひろ"}
+]
+[[0,0.0,0.0],4]
+select --table Names --query _key:^ひろ
+[
+ [
+ 0,
+ 0.0,
+ 0.0
+ ],
+ [
+ [
+ [
+ 2
+ ],
+ [
+ [
+ "_id",
+ "UInt32"
+ ],
+ [
+ "_key",
+ "ShortText"
+ ]
+ ],
+ [
+ 1,
+ "ひろゆき"
+ ],
+ [
+ 3,
+ "ひろあき"
+ ]
+ ]
+ ]
+]
Added: test/function/suite/select/query/prefix_search/patricia_trie.test (+9 -0) 100644
===================================================================
--- /dev/null
+++ test/function/suite/select/query/prefix_search/patricia_trie.test 2012-06-16 12:15:38 +0900 (5795a7c)
@@ -0,0 +1,9 @@
+table_create Names TABLE_PAT_KEY ShortText
+load --table Names
+[
+{"_key":"ひろゆき"},
+{"_key":"まろゆき"},
+{"_key":"ひろあき"},
+{"_key":"ゆきひろ"}
+]
+select --table Names --query _key:^ひろ