Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #73 from ranguba/add-tests-of-type-for-tokenizers
Browse files Browse the repository at this point in the history
test: add tests of Groonga::Type for tokenizers
  • Loading branch information
kou committed Apr 2, 2015
2 parents 4437782 + 548f046 commit 4a12980
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/test-type.rb
@@ -1,4 +1,5 @@
# Copyright (C) 2009-2012 Kouhei Sutou <kou@clear-code.com>
# Copyright (C) 2015 Masafumi Yokoyama <yokoyama@clear-code.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -133,4 +134,26 @@ def assert_equal_type(expected_name, id)
assert_equal(expected_name,
type ? type.name : type)
end

class TokenizerTest < self
def test_delimit
assert_equal_type("TokenDelimit", Groonga::Type::DELIMIT)
end

def test_unigram
assert_equal_type("TokenUnigram", Groonga::Type::UNIGRAM)
end

def test_bigram
assert_equal_type("TokenBigram", Groonga::Type::BIGRAM)
end

def test_trigram
assert_equal_type("TokenTrigram", Groonga::Type::TRIGRAM)
end

def test_mecab
assert_equal_type("TokenMecab", Groonga::Type::MECAB)
end
end
end

0 comments on commit 4a12980

Please sign in to comment.