[Groonga-commit] groonga/grnci at d082991 [master] Add a test for tokenize.

Back to archive index

Susumu Yata null+****@clear*****
Fri Jul 7 12:52:55 JST 2017


Susumu Yata	2017-07-07 12:52:55 +0900 (Fri, 07 Jul 2017)

  New Revision: d082991ac3f9c972723861c14bfdf7edd7984eb8
  https://github.com/groonga/grnci/commit/d082991ac3f9c972723861c14bfdf7edd7984eb8

  Message:
    Add a test for tokenize.
    
    GitHub: #39

  Modified files:
    v2/libgrn/db_test.go

  Modified: v2/libgrn/db_test.go (+13 -0)
===================================================================
--- v2/libgrn/db_test.go    2017-07-07 12:15:21 +0900 (97fa952)
+++ v2/libgrn/db_test.go    2017-07-07 12:52:55 +0900 (d483356)
@@ -594,6 +594,19 @@ func TestDBTokenize(t *testing.T) {
 	}
 }
 
+func TestDBTokenizeInvalidTokenizer(t *testing.T) {
+	db, dir := makeDB(t)
+	defer removeDB(db, dir)
+
+	_, resp, err := db.Tokenize("", "あいうえお", nil)
+	if err != nil {
+		t.Fatalf("db.Tokenize failed: %v", err)
+	}
+	if resp.Err() == nil {
+		t.Fatalf("db.Tokenize wrongly succeeded")
+	}
+}
+
 func TestDBTokenizeWithOptions(t *testing.T) {
 	db, dir := makeDB(t)
 	defer removeDB(db, dir)
-------------- next part --------------
HTML����������������������������...
Download 



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