null+****@clear*****
null+****@clear*****
2012年 1月 19日 (木) 17:39:29 JST
Ryo Onodera 2012-01-19 17:39:29 +0900 (Thu, 19 Jan 2012) New Revision: 88347e2fbc7d9e866b447ede70d6f07a71dad0d7 Log: [suggest][complete] add tests of completion for different behavior with upcase or downcase queries Modified files: test/unit/fixtures/story/rurema/items.grn test/unit/story/test-rurema.c Modified: test/unit/fixtures/story/rurema/items.grn (+2 -1) =================================================================== --- test/unit/fixtures/story/rurema/items.grn 2012-01-19 17:16:04 +0900 (14786e4) +++ test/unit/fixtures/story/rurema/items.grn 2012-01-19 17:39:29 +0900 (b94d3b6) @@ -11,5 +11,6 @@ load --table item_rurema ["彼女ほしい","カノジョホシイ",0], ["どれどれ","ドレドレ",0], ["置換","チカン",0], -["値","ネ",0] +["値","ネ",0], +["SSH","エスエスエイチ",100] ] Modified: test/unit/story/test-rurema.c (+38 -0) =================================================================== --- test/unit/story/test-rurema.c 2012-01-19 17:16:04 +0900 (d5c9a18) +++ test/unit/story/test-rurema.c 2012-01-19 17:39:29 +0900 (54ddd46) @@ -30,6 +30,8 @@ void data_complete_prefix_search(void); void test_complete_prefix_search(gconstpointer data); void test_complete_prefix_search_threshold_found(void); void test_complete_prefix_search_threshold_not_found(void); +void test_complete_prefix_search_upcase(void); +void test_complete_prefix_search_downcase(void); void test_correct_cooccurrence(void); void test_correct_similar(void); void test_suggest_cooccurrence(void); @@ -266,6 +268,42 @@ test_complete_prefix_search_threshold_not_fuond(void) } void +test_complete_prefix_search_upcase(void) +{ + cut_assert_equal_string( + "{\"complete\":" + "[[1]," + "[[\"_key\",\"ShortText\"]," + "[\"_score\",\"Int32\"]]," + "[\"ssh\",101]]}", + send_command( + "suggest " + "--table item_rurema " + "--column kana " + "--types complete " + "--frequency_threshold 1 " + "--query 'SSH'")); +} + +void +test_complete_prefix_search_downcase(void) +{ + cut_assert_equal_string( + "{\"complete\":" + "[[1]," + "[[\"_key\",\"ShortText\"]," + "[\"_score\",\"Int32\"]]," + "[\"ssh\",101]]}", + send_command( + "suggest " + "--table item_rurema " + "--column kana " + "--types complete " + "--frequency_threshold 1 " + "--query 'ssh'")); +} + +void test_correct_coocurrence(void) { cut_assert_equal_string(