[Groonga-commit] groonga/groonga at e188323 [master] test TokenRegexp: add tests for using with normalizer

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Mar 13 16:04:14 JST 2015


Kouhei Sutou	2015-03-13 16:04:14 +0900 (Fri, 13 Mar 2015)

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

  Message:
    test TokenRegexp: add tests for using with normalizer

  Added files:
    test/command/suite/select/filter/index/regexp/normalizer/begin.expected
    test/command/suite/select/filter/index/regexp/normalizer/begin.test
    test/command/suite/select/filter/index/regexp/normalizer/end.expected
    test/command/suite/select/filter/index/regexp/normalizer/end.test

  Added: test/command/suite/select/filter/index/regexp/normalizer/begin.expected (+17 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/index/regexp/normalizer/begin.expected    2015-03-13 16:04:14 +0900 (269c399)
@@ -0,0 +1,17 @@
+table_create Memos TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Memos content COLUMN_SCALAR Text
+[[0,0.0,0.0],true]
+table_create RegexpTokens TABLE_PAT_KEY ShortText   --default_tokenizer TokenRegexp   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create RegexpTokens memos_content COLUMN_INDEX|WITH_POSITION   Memos content
+[[0,0.0,0.0],true]
+load --table Memos
+[
+{"content": "Groonga"},
+{"content": "Rroonga"},
+{"content": "Ruby and Rroonga"}
+]
+[[0,0.0,0.0],3]
+select Memos --filter 'content @~ "\\\\ARRO"'
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["content","Text"]],[2,"Rroonga"]]]]

  Added: test/command/suite/select/filter/index/regexp/normalizer/begin.test (+17 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/index/regexp/normalizer/begin.test    2015-03-13 16:04:14 +0900 (811aea4)
@@ -0,0 +1,17 @@
+table_create Memos TABLE_NO_KEY
+column_create Memos content COLUMN_SCALAR Text
+
+table_create RegexpTokens TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenRegexp \
+  --normalizer NormalizerAuto
+column_create RegexpTokens memos_content COLUMN_INDEX|WITH_POSITION \
+  Memos content
+
+load --table Memos
+[
+{"content": "Groonga"},
+{"content": "Rroonga"},
+{"content": "Ruby and Rroonga"}
+]
+
+select Memos --filter 'content @~ "\\\\ARRO"'

  Added: test/command/suite/select/filter/index/regexp/normalizer/end.expected (+48 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/index/regexp/normalizer/end.expected    2015-03-13 16:04:14 +0900 (b50dcfe)
@@ -0,0 +1,48 @@
+table_create Memos TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Memos content COLUMN_SCALAR Text
+[[0,0.0,0.0],true]
+table_create RegexpTokens TABLE_PAT_KEY ShortText   --default_tokenizer TokenRegexp   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create RegexpTokens memos_content COLUMN_INDEX|WITH_POSITION   Memos content
+[[0,0.0,0.0],true]
+load --table Memos
+[
+{"content": "Groonga"},
+{"content": "Mroonga"},
+{"content": "Rroonga and Ruby"}
+]
+[[0,0.0,0.0],3]
+select Memos --filter 'content @~ "ONGA\\\\z"'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        2
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "content",
+          "Text"
+        ]
+      ],
+      [
+        1,
+        "Groonga"
+      ],
+      [
+        2,
+        "Mroonga"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/filter/index/regexp/normalizer/end.test (+17 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/index/regexp/normalizer/end.test    2015-03-13 16:04:14 +0900 (c6694f7)
@@ -0,0 +1,17 @@
+table_create Memos TABLE_NO_KEY
+column_create Memos content COLUMN_SCALAR Text
+
+table_create RegexpTokens TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenRegexp \
+  --normalizer NormalizerAuto
+column_create RegexpTokens memos_content COLUMN_INDEX|WITH_POSITION \
+  Memos content
+
+load --table Memos
+[
+{"content": "Groonga"},
+{"content": "Mroonga"},
+{"content": "Rroonga and Ruby"}
+]
+
+select Memos --filter 'content @~ "ONGA\\\\z"'
-------------- next part --------------
HTML����������������������������...
Download 



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