Navigation Menu

Skip to content

Commit

Permalink
Normalize TokenRegexp type
Browse files Browse the repository at this point in the history
  • Loading branch information
Masafumi Yokoyama committed Apr 2, 2015
1 parent 4437782 commit b1f2e98
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/groonga/schema.rb
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009-2014 Kouhei Sutou <kou@clear-code.com>
# Copyright (C) 2014 Masafumi Yokoyama <myokoym@gmail.com>
# Copyright (C) 2014-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 @@ -598,6 +598,8 @@ def restore(dumped_text, options={})
"token_trigram" => "TokenTrigram",
"mecab" => "TokenMecab",
"token_mecab"=> "TokenMecab",
"regexp" => "TokenRegexp",
"token_regexp"=> "TokenRegexp",
}
# @private
def normalize_type(type, options={})
Expand Down
6 changes: 6 additions & 0 deletions test/test-schema-type.rb
Expand Up @@ -201,6 +201,12 @@ def test_normalize_mecab
assert_normalize_type("TokenMecab", "TokenMecab")
end

def test_normalize_regexp
assert_normalize_type("TokenRegexp", "regexp")
assert_normalize_type("TokenRegexp", "token_regexp")
assert_normalize_type("TokenRegexp", "TokenRegexp")
end

private
def assert_normalize_type(expected, type)
assert_equal(expected, Groonga::Schema.normalize_type(type))
Expand Down

0 comments on commit b1f2e98

Please sign in to comment.