summaryrefslogtreecommitdiff
path: root/src/tests/evas
diff options
context:
space:
mode:
authorali <ali198724@gmail.com>2019-12-26 16:05:37 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2019-12-26 16:05:37 +0900
commita239fc4a1a22ba05a7106248c0cb1655cc87d2c3 (patch)
tree391871e705f79e66978b9ad0ae2922de3fec6831 /src/tests/evas
parent84685df233b2e499227a6c4e990c6216117a9a21 (diff)
efl_text_cursor: movement word start/end
Summary: This patch will make **efl_text_cursor_move** method, when it is working with **WORD_START** or **WORD_END** If no actual movement happened then return false, and do not fire CHANGE event for example if cursor at word start, and we call efl_text_cursor_move(cursor, word_start); 1- this call should return false because no actual movement happened. If no actual movement happened then return false 2- this call should not fire CHANGE event for cursor.and do not fire CHANGE event Reviewers: woohyun, segfaultxavi, cedric, zmike Reviewed By: woohyun Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8454 Differential Revision: https://phab.enlightenment.org/D10949
Diffstat (limited to 'src/tests/evas')
-rw-r--r--src/tests/evas/evas_test_textblock.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c
index 3a112a0048..33bbad6472 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -4513,7 +4513,6 @@ EFL_START_TEST(efl_canvas_textblock_cursor)
4513 efl_text_set(txt, ""); 4513 efl_text_set(txt, "");
4514 efl_text_set(txt, ""); 4514 efl_text_set(txt, "");
4515 efl_text_cursor_text_insert(cursor1, "aa"); 4515 efl_text_cursor_text_insert(cursor1, "aa");
4516
4517 ck_assert_int_eq(changed_emit, 3); 4516 ck_assert_int_eq(changed_emit, 3);
4518 4517
4519 Eo *cursor_temp = efl_add(EFL_TEXT_CURSOR_CLASS, txt); 4518 Eo *cursor_temp = efl_add(EFL_TEXT_CURSOR_CLASS, txt);
@@ -4528,6 +4527,21 @@ EFL_START_TEST(efl_canvas_textblock_cursor)
4528 efl_text_cursor_line_jump_by(cur_obj, -1); 4527 efl_text_cursor_line_jump_by(cur_obj, -1);
4529 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0); 4528 ck_assert_int_eq(efl_text_cursor_position_get(cur_obj), 0);
4530 4529
4530 efl_text_set(txt, "Word");
4531 efl_text_cursor_position_set(cur_obj, 1);
4532 changed_emit = 0;
4533 efl_event_callback_add(cur_obj, EFL_TEXT_CURSOR_EVENT_CHANGED, _increment_int_changed, &changed_emit);
4534 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START));
4535 ck_assert_int_eq(changed_emit, 1);
4536
4537 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START));
4538 ck_assert_int_eq(changed_emit, 1);
4539
4540 ck_assert(efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END));
4541 ck_assert_int_eq(changed_emit, 2);
4542
4543 ck_assert(!efl_text_cursor_move(cur_obj, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END));
4544 ck_assert_int_eq(changed_emit, 2);
4531 4545
4532 END_EFL_CANVAS_TEXTBLOCK_TEST(); 4546 END_EFL_CANVAS_TEXTBLOCK_TEST();
4533} 4547}