summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorAli Alzyod <ali198724@gmail.com>2020-09-14 16:30:06 +0000
committerStefan Schmidt <stefan@datenfreihafen.org>2020-09-16 14:40:55 +0200
commit3bd066c7dbffc2655501dea0b8d44d567ac1113b (patch)
tree44aef36838a308fdeab611f664c05e2045c45678 /src/tests
parent35f17a13fa0cd1de855cc2215e4f0ac9da6fb7bc (diff)
downloadefl-3bd066c7dbffc2655501dea0b8d44d567ac1113b.tar.gz
evas_textblock: prevent textnodes with <ps>/<br> without format node
this will prevent textnodes content with <ps> or <br> without format node Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Differential Revision: https://phab.enlightenment.org/D12145
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/elementary/elm_test_entry.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tests/elementary/elm_test_entry.c b/src/tests/elementary/elm_test_entry.c
index 5df40b19ec..85ada68a49 100644
--- a/src/tests/elementary/elm_test_entry.c
+++ b/src/tests/elementary/elm_test_entry.c
@@ -653,6 +653,28 @@ EFL_START_TEST(elm_entry_keycode)
}
EFL_END_TEST
+EFL_START_TEST(elm_entry_textnodes_with_no_format)
+{
+ Evas_Object *win, *entry;
+
+ win = win_add(NULL, "entry", ELM_WIN_BASIC);
+ entry = elm_entry_add(win);
+ evas_object_show(entry);
+
+ elm_entry_entry_set(entry, "<br/><br/>");
+ Evas_Object *tb = elm_entry_textblock_get(entry);
+ Evas_Textblock_Cursor *c1 = evas_object_textblock_cursor_new(tb);
+ Evas_Textblock_Cursor *c2 = evas_object_textblock_cursor_new(tb);
+ evas_textblock_cursor_char_next(c2);
+ evas_textblock_cursor_range_delete(c1, c2);
+ elm_entry_cursor_pos_set(entry, 0);
+ ck_assert(elm_entry_cursor_down(entry));
+
+ evas_object_del(entry);
+ evas_object_del(win);
+}
+EFL_END_TEST
+
void elm_test_entry(TCase *tc)
{
tcase_add_test(tc, elm_entry_legacy_type_check);
@@ -674,4 +696,5 @@ void elm_test_entry(TCase *tc)
tcase_add_test(tc, elm_entry_test_text_class);
tcase_add_test(tc, elm_entry_test_burmese);
tcase_add_test(tc, elm_entry_keycode);
+ tcase_add_test(tc, elm_entry_textnodes_with_no_format);
}