[Groonga-commit] groonga/groonga at 08e7520 [master] test: add missing tests for '<', '>' and '~'

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Feb 13 18:10:26 JST 2018


Kouhei Sutou	2018-02-13 18:10:26 +0900 (Tue, 13 Feb 2018)

  New Revision: 08e7520bfc6be9dc81404311961a5b1007af7c8b
  https://github.com/groonga/groonga/commit/08e7520bfc6be9dc81404311961a5b1007af7c8b

  Message:
    test: add missing tests for '<', '>' and '~'

  Added files:
    test/command/suite/select/query/adjust/decrement.expected
    test/command/suite/select/query/adjust/decrement.test
    test/command/suite/select/query/adjust/increment.expected
    test/command/suite/select/query/adjust/increment.test
    test/command/suite/select/query/adjust/mix.expected
    test/command/suite/select/query/adjust/mix.test
    test/command/suite/select/query/adjust/negative.expected
    test/command/suite/select/query/adjust/negative.test

  Added: test/command/suite/select/query/adjust/decrement.expected (+44 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query/adjust/decrement.expected    2018-02-13 18:10:26 +0900 (5744f5607)
@@ -0,0 +1,44 @@
+table_create Memos TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Memos content COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+table_create Terms TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Terms index COLUMN_INDEX|WITH_POSITION Memos content
+[[0,0.0,0.0],true]
+load --table Memos
+[
+{"content": "Groonga is a full text search engine."},
+{"content": "Rroonga is the Ruby bindings of Groonga."},
+{"content": "Mroonga is a MySQL storage engine based of Groonga."}
+]
+[[0,0.0,0.0],3]
+select Memos   --match_columns content   --query 'Groonga <Ruby'   --output_columns 'content, _score'   --sort_keys -_score,_id
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "content",
+          "ShortText"
+        ],
+        [
+          "_score",
+          "Int32"
+        ]
+      ],
+      [
+        "Rroonga is the Ruby bindings of Groonga.",
+        6
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/query/adjust/decrement.test (+21 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query/adjust/decrement.test    2018-02-13 18:10:26 +0900 (5d9222161)
@@ -0,0 +1,21 @@
+table_create Memos TABLE_NO_KEY
+column_create Memos content COLUMN_SCALAR ShortText
+
+table_create Terms TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create Terms index COLUMN_INDEX|WITH_POSITION Memos content
+
+load --table Memos
+[
+{"content": "Groonga is a full text search engine."},
+{"content": "Rroonga is the Ruby bindings of Groonga."},
+{"content": "Mroonga is a MySQL storage engine based of Groonga."}
+]
+
+select Memos \
+  --match_columns content \
+  --query 'Groonga <Ruby' \
+  --output_columns 'content, _score' \
+  --sort_keys -_score,_id
+

  Added: test/command/suite/select/query/adjust/increment.expected (+44 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query/adjust/increment.expected    2018-02-13 18:10:26 +0900 (9ee8e9d44)
@@ -0,0 +1,44 @@
+table_create Memos TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Memos content COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+table_create Terms TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Terms index COLUMN_INDEX|WITH_POSITION Memos content
+[[0,0.0,0.0],true]
+load --table Memos
+[
+{"content": "Groonga is a full text search engine."},
+{"content": "Rroonga is the Ruby bindings of Groonga."},
+{"content": "Mroonga is a MySQL storage engine based of Groonga."}
+]
+[[0,0.0,0.0],3]
+select Memos   --match_columns content   --query 'Groonga >Ruby'   --output_columns 'content, _score'   --sort_keys -_score,_id
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "content",
+          "ShortText"
+        ],
+        [
+          "_score",
+          "Int32"
+        ]
+      ],
+      [
+        "Rroonga is the Ruby bindings of Groonga.",
+        8
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/query/adjust/increment.test (+21 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query/adjust/increment.test    2018-02-13 18:10:26 +0900 (e838124bc)
@@ -0,0 +1,21 @@
+table_create Memos TABLE_NO_KEY
+column_create Memos content COLUMN_SCALAR ShortText
+
+table_create Terms TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create Terms index COLUMN_INDEX|WITH_POSITION Memos content
+
+load --table Memos
+[
+{"content": "Groonga is a full text search engine."},
+{"content": "Rroonga is the Ruby bindings of Groonga."},
+{"content": "Mroonga is a MySQL storage engine based of Groonga."}
+]
+
+select Memos \
+  --match_columns content \
+  --query 'Groonga >Ruby' \
+  --output_columns 'content, _score' \
+  --sort_keys -_score,_id
+

  Added: test/command/suite/select/query/adjust/mix.expected (+48 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query/adjust/mix.expected    2018-02-13 18:10:26 +0900 (82ed985ce)
@@ -0,0 +1,48 @@
+table_create Memos TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Memos content COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+table_create Terms TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Terms index COLUMN_INDEX|WITH_POSITION Memos content
+[[0,0.0,0.0],true]
+load --table Memos
+[
+{"content": "Groonga is a full text search engine."},
+{"content": "Rroonga is the Ruby bindings of Groonga."},
+{"content": "Mroonga is a MySQL storage engine based of Groonga."}
+]
+[[0,0.0,0.0],3]
+select Memos   --match_columns content   --query 'Groonga (>Ruby OR <Mroonga) ~MySQL'   --output_columns 'content, _score'   --sort_keys -_score,_id
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        2
+      ],
+      [
+        [
+          "content",
+          "ShortText"
+        ],
+        [
+          "_score",
+          "Int32"
+        ]
+      ],
+      [
+        "Rroonga is the Ruby bindings of Groonga.",
+        8
+      ],
+      [
+        "Mroonga is a MySQL storage engine based of Groonga.",
+        3
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/query/adjust/mix.test (+20 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query/adjust/mix.test    2018-02-13 18:10:26 +0900 (2fefde910)
@@ -0,0 +1,20 @@
+table_create Memos TABLE_NO_KEY
+column_create Memos content COLUMN_SCALAR ShortText
+
+table_create Terms TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create Terms index COLUMN_INDEX|WITH_POSITION Memos content
+
+load --table Memos
+[
+{"content": "Groonga is a full text search engine."},
+{"content": "Rroonga is the Ruby bindings of Groonga."},
+{"content": "Mroonga is a MySQL storage engine based of Groonga."}
+]
+
+select Memos \
+  --match_columns content \
+  --query 'Groonga (>Ruby OR <Mroonga) ~MySQL' \
+  --output_columns 'content, _score' \
+  --sort_keys -_score,_id

  Added: test/command/suite/select/query/adjust/negative.expected (+52 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query/adjust/negative.expected    2018-02-13 18:10:26 +0900 (595846940)
@@ -0,0 +1,52 @@
+table_create Memos TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Memos content COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+table_create Terms TABLE_PAT_KEY ShortText   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create Terms index COLUMN_INDEX|WITH_POSITION Memos content
+[[0,0.0,0.0],true]
+load --table Memos
+[
+{"content": "Groonga is a full text search engine."},
+{"content": "Rroonga is the Ruby bindings of Groonga."},
+{"content": "Mroonga is a MySQL storage engine based of Groonga."}
+]
+[[0,0.0,0.0],3]
+select Memos   --match_columns content   --query 'Groonga ~Ruby'   --output_columns 'content, _score'   --sort_keys -_score,_id
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        3
+      ],
+      [
+        [
+          "content",
+          "ShortText"
+        ],
+        [
+          "_score",
+          "Int32"
+        ]
+      ],
+      [
+        "Groonga is a full text search engine.",
+        1
+      ],
+      [
+        "Mroonga is a MySQL storage engine based of Groonga.",
+        1
+      ],
+      [
+        "Rroonga is the Ruby bindings of Groonga.",
+        -3
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/query/adjust/negative.test (+20 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/query/adjust/negative.test    2018-02-13 18:10:26 +0900 (b999b20c6)
@@ -0,0 +1,20 @@
+table_create Memos TABLE_NO_KEY
+column_create Memos content COLUMN_SCALAR ShortText
+
+table_create Terms TABLE_PAT_KEY ShortText \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create Terms index COLUMN_INDEX|WITH_POSITION Memos content
+
+load --table Memos
+[
+{"content": "Groonga is a full text search engine."},
+{"content": "Rroonga is the Ruby bindings of Groonga."},
+{"content": "Mroonga is a MySQL storage engine based of Groonga."}
+]
+
+select Memos \
+  --match_columns content \
+  --query 'Groonga ~Ruby' \
+  --output_columns 'content, _score' \
+  --sort_keys -_score,_id
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180213/d3307ece/attachment-0001.htm 



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