[Groonga-commit] groonga/groonga at 717de1c [master] ii regexp test: add ".*" with "\A" and "\z" patterns

Zurück zum Archiv-Index

Kouhei Sutou null+****@clear*****
Wed Apr 12 16:07:57 JST 2017


Kouhei Sutou	2017-04-12 16:07:57 +0900 (Wed, 12 Apr 2017)

  New Revision: 717de1cf66c3296571f177249ba1133e89004000
  https://github.com/groonga/groonga/commit/717de1cf66c3296571f177249ba1133e89004000

  Message:
    ii regexp test: add ".*" with "\A" and "\z" patterns

  Added files:
    test/command/suite/select/filter/index/regexp/dot_asterisk/one_begin.expected
    test/command/suite/select/filter/index/regexp/dot_asterisk/one_begin.test
    test/command/suite/select/filter/index/regexp/dot_asterisk/one_begin_end.expected
    test/command/suite/select/filter/index/regexp/dot_asterisk/one_begin_end.test
    test/command/suite/select/filter/index/regexp/dot_asterisk/one_end.expected
    test/command/suite/select/filter/index/regexp/dot_asterisk/one_end.test

  Added: test/command/suite/select/filter/index/regexp/dot_asterisk/one_begin.expected (+27 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/index/regexp/dot_asterisk/one_begin.expected    2017-04-12 16:07:57 +0900 (93f7af6)
@@ -0,0 +1,27 @@
+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   --normalizer NormalizerAuto   --default_tokenizer TokenRegexp
+[[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": "PGroonga"}
+]
+[[0,0.0,0.0],3]
+log_level --level info
+[[0,0.0,0.0],true]
+select Memos --filter 'content @~ "\\\\Ag.*ga"'
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["content","Text"]],[1,"Groonga"]]]]
+#|i| [object][search][index][key][regexp] <RegexpTokens.memos_content>
+#|i| grn_ii_sel > (\Ag.*ga)
+#|i| [ii][select][cursor][open] n=2 <￯g>
+#|i| [ii][select][cursor][open] n=1 <ga>
+#|i| exact: 1
+#|i| hits=1
+log_level --level notice
+[[0,0.0,0.0],true]

  Added: test/command/suite/select/filter/index/regexp/dot_asterisk/one_begin.test (+23 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/index/regexp/dot_asterisk/one_begin.test    2017-04-12 16:07:57 +0900 (8a791cd)
@@ -0,0 +1,23 @@
+#$GRN_II_REGEXP_DOT_ASTERISK_ENABLE=yes
+
+table_create Memos TABLE_NO_KEY
+column_create Memos content COLUMN_SCALAR Text
+
+table_create RegexpTokens TABLE_PAT_KEY ShortText \
+  --normalizer NormalizerAuto \
+  --default_tokenizer TokenRegexp
+column_create RegexpTokens memos_content COLUMN_INDEX|WITH_POSITION \
+  Memos content
+
+load --table Memos
+[
+{"content": "Groonga"},
+{"content": "Rroonga"},
+{"content": "PGroonga"}
+]
+
+log_level --level info
+#@add-important-log-levels info
+select Memos --filter 'content @~ "\\\\Ag.*ga"'
+#@remove-important-log-levels info
+log_level --level notice

  Added: test/command/suite/select/filter/index/regexp/dot_asterisk/one_begin_end.expected (+58 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/index/regexp/dot_asterisk/one_begin_end.expected    2017-04-12 16:07:57 +0900 (cb674b0)
@@ -0,0 +1,58 @@
+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   --normalizer NormalizerAuto   --default_tokenizer TokenRegexp
+[[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": "PGroonga"},
+{"content": "Grooooonga"}
+]
+[[0,0.0,0.0],3]
+log_level --level info
+[[0,0.0,0.0],true]
+select Memos --filter 'content @~ "\\\\Ag.*ga\\\\z"'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        2
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "content",
+          "Text"
+        ]
+      ],
+      [
+        1,
+        "Groonga"
+      ],
+      [
+        3,
+        "Grooooonga"
+      ]
+    ]
+  ]
+]
+#|i| [object][search][index][key][regexp] <RegexpTokens.memos_content>
+#|i| grn_ii_sel > (\Ag.*ga\z)
+#|i| [ii][select][cursor][open] n=2 <￯g>
+#|i| [ii][select][cursor][open] n=2 <ga￰>
+#|i| exact: 2
+#|i| hits=2
+log_level --level notice
+[[0,0.0,0.0],true]

  Added: test/command/suite/select/filter/index/regexp/dot_asterisk/one_begin_end.test (+23 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/index/regexp/dot_asterisk/one_begin_end.test    2017-04-12 16:07:57 +0900 (f392c95)
@@ -0,0 +1,23 @@
+#$GRN_II_REGEXP_DOT_ASTERISK_ENABLE=yes
+
+table_create Memos TABLE_NO_KEY
+column_create Memos content COLUMN_SCALAR Text
+
+table_create RegexpTokens TABLE_PAT_KEY ShortText \
+  --normalizer NormalizerAuto \
+  --default_tokenizer TokenRegexp
+column_create RegexpTokens memos_content COLUMN_INDEX|WITH_POSITION \
+  Memos content
+
+load --table Memos
+[
+{"content": "Groonga"},
+{"content": "PGroonga"},
+{"content": "Grooooonga"}
+]
+
+log_level --level info
+#@add-important-log-levels info
+select Memos --filter 'content @~ "\\\\Ag.*ga\\\\z"'
+#@remove-important-log-levels info
+log_level --level notice

  Added: test/command/suite/select/filter/index/regexp/dot_asterisk/one_end.expected (+27 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/index/regexp/dot_asterisk/one_end.expected    2017-04-12 16:07:57 +0900 (217dcc8)
@@ -0,0 +1,27 @@
+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   --normalizer NormalizerAuto   --default_tokenizer TokenRegexp
+[[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": "groonga server"},
+{"content": "groonga-httpd"}
+]
+[[0,0.0,0.0],3]
+log_level --level info
+[[0,0.0,0.0],true]
+select Memos --filter 'content @~ "g.*ga\\\\z"'
+[[0,0.0,0.0],[[[1],[["_id","UInt32"],["content","Text"]],[1,"groonga"]]]]
+#|i| [object][search][index][key][regexp] <RegexpTokens.memos_content>
+#|i| grn_ii_sel > (g.*ga\z)
+#|i| [ii][select][cursor][open] n=1 <g>
+#|i| [ii][select][cursor][open] n=2 <ga￰>
+#|i| exact: 1
+#|i| hits=1
+log_level --level notice
+[[0,0.0,0.0],true]

  Added: test/command/suite/select/filter/index/regexp/dot_asterisk/one_end.test (+23 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/index/regexp/dot_asterisk/one_end.test    2017-04-12 16:07:57 +0900 (deca6be)
@@ -0,0 +1,23 @@
+#$GRN_II_REGEXP_DOT_ASTERISK_ENABLE=yes
+
+table_create Memos TABLE_NO_KEY
+column_create Memos content COLUMN_SCALAR Text
+
+table_create RegexpTokens TABLE_PAT_KEY ShortText \
+  --normalizer NormalizerAuto \
+  --default_tokenizer TokenRegexp
+column_create RegexpTokens memos_content COLUMN_INDEX|WITH_POSITION \
+  Memos content
+
+load --table Memos
+[
+{"content": "groonga"},
+{"content": "groonga server"},
+{"content": "groonga-httpd"}
+]
+
+log_level --level info
+#@add-important-log-levels info
+select Memos --filter 'content @~ "g.*ga\\\\z"'
+#@remove-important-log-levels info
+log_level --level notice
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Zurück zum Archiv-Index