~chewing/libchewing/libchewing

« back to all changes in this revision

Viewing changes to test/test-bopomofo.c

  • Committer: GitHub
  • Author(s): Jim Huang
  • Date: 2017-08-09 11:29:52 UTC
  • mfrom: (1363.1.1)
  • Revision ID: git-v1:7282e054ad87023ef5991f292709f84c396bbdba
Merge pull request #274 from hiunnhue/fix_space

Fix: chewing_handle_Space() cannot input space when buffer is empty

Show diffs side-by-side

added added

removed removed

Lines of Context:
1134
1134
    test_Numlock_select_candidate();
1135
1135
}
1136
1136
 
 
1137
void test_Space_empty_buffer()
 
1138
{
 
1139
    ChewingContext *ctx;
 
1140
 
 
1141
    clean_userphrase();
 
1142
 
 
1143
    ctx = chewing_new();
 
1144
    start_testcase(ctx, fd);
 
1145
    chewing_set_spaceAsSelection(ctx, 1);
 
1146
 
 
1147
    type_keystroke_by_string(ctx, " ");
 
1148
    ok_preedit_buffer(ctx, "");
 
1149
    ok_commit_buffer(ctx, " ");
 
1150
 
 
1151
    chewing_delete(ctx);
 
1152
}
 
1153
 
1137
1154
void test_Space_selection_word()
1138
1155
{
1139
1156
    ChewingContext *ctx;
1205
1222
 
1206
1223
void test_Space()
1207
1224
{
 
1225
    test_Space_empty_buffer();
1208
1226
    test_Space_selection_word();
1209
1227
    test_Space_selection_symbol();
1210
1228
}