[Groonga-commit] groonga/groonga [master] Add a test for calling snippet_html() twice

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Mar 4 22:56:19 JST 2013


Kouhei Sutou	2013-03-04 22:56:19 +0900 (Mon, 04 Mar 2013)

  New Revision: 42f662e1d71f4b044bc92e03f66ef3a3076fe817
  https://github.com/groonga/groonga/commit/42f662e1d71f4b044bc92e03f66ef3a3076fe817

  Log:
    Add a test for calling snippet_html() twice

  Added files:
    test/command/suite/select/function/snippet_html/twice.expected
    test/command/suite/select/function/snippet_html/twice.test

  Added: test/command/suite/select/function/snippet_html/twice.expected (+60 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/function/snippet_html/twice.expected    2013-03-04 22:56:19 +0900 (86ccbd2)
@@ -0,0 +1,60 @@
+table_create Entries TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Entries title COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+column_create Entries content COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+table_create Tokens TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
+[[0,0.0,0.0],true]
+column_create Tokens entries_title COLUMN_INDEX|WITH_POSITION Entries title
+[[0,0.0,0.0],true]
+column_create Tokens entries_content COLUMN_INDEX|WITH_POSITION Entries content
+[[0,0.0,0.0],true]
+load --table Entries
+[
+{"title": "groonga and MySQL", "content": "groonga + MySQL = mroonga."}
+]
+[[0,0.0,0.0],1]
+select Entries   --output_columns 'snippet_html(title), snippet_html(content), title, content'   --command_version 2   --match_columns 'title'   --query groonga
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "snippet_html",
+          "null"
+        ],
+        [
+          "snippet_html",
+          "null"
+        ],
+        [
+          "title",
+          "ShortText"
+        ],
+        [
+          "content",
+          "ShortText"
+        ]
+      ],
+      [
+        [
+          "<span class=\"keyword\">groonga</span> and MySQL"
+        ],
+        [
+          "<span class=\"keyword\">groonga</span> + MySQL = mroonga."
+        ],
+        "groonga and MySQL",
+        "groonga + MySQL = mroonga."
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/function/snippet_html/twice.test (+18 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/function/snippet_html/twice.test    2013-03-04 22:56:19 +0900 (8eea109)
@@ -0,0 +1,18 @@
+table_create Entries TABLE_NO_KEY
+column_create Entries title COLUMN_SCALAR ShortText
+column_create Entries content COLUMN_SCALAR ShortText
+
+table_create Tokens TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
+column_create Tokens entries_title COLUMN_INDEX|WITH_POSITION Entries title
+column_create Tokens entries_content COLUMN_INDEX|WITH_POSITION Entries content
+
+load --table Entries
+[
+{"title": "groonga and MySQL", "content": "groonga + MySQL = mroonga."}
+]
+
+select Entries \
+  --output_columns 'snippet_html(title), snippet_html(content), title, content' \
+  --command_version 2 \
+  --match_columns 'title' \
+  --query groonga
-------------- next part --------------
HTML����������������������������...
下載 



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