summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorali <ali198724@gmail.com>2019-08-03 09:19:20 +0000
committerCedric BAIL <cedric.bail@free.fr>2019-08-19 11:33:25 -0700
commite08ca174888da9d11742e2b08501a1449ebe5b7d (patch)
tree074b068c7d1e2e7285187f44830bb10d77725545 /src/tests
parenta821eb456a8c89943f306286669093e2a43aa1f1 (diff)
evas_textblock: markup text: improve handling invalide escape characters
Improve handling invalid escape characters. (*) When '&' character founded in Markup text. Old Behavior : Any text after '&' (if it is not escape), all text will be discarded New Behavior : Any text after '&' (if it is not escape), will be processes as normal plain text. Example: Markup Text : Hello X & Y & Z 1 2 3 Old output : Hello New output : Hello X & Y & Z 1 2 3 This is related to T8077 Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D9489
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/evas/evas_test_textblock.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c
index ef81ae3172..f61574c065 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -4654,6 +4654,29 @@ EFL_START_TEST(efl_canvas_text_markup)
4654} 4654}
4655EFL_END_TEST 4655EFL_END_TEST
4656 4656
4657EFL_START_TEST(efl_canvas_text_markup_invalid_escape)
4658{
4659 START_EFL_CANVAS_TEXT_TEST();
4660
4661 char * text1 = "Hello";
4662 char * text2 = "Hello&123";
4663 char * text3 = "Hello&123&456";
4664 Evas_Coord fw1, fw2, fw3;
4665
4666 efl_text_markup_set(txt,text1);
4667 efl_canvas_text_size_native_get(txt, &fw1, NULL);
4668 efl_text_markup_set(txt,text2);
4669 efl_canvas_text_size_native_get(txt, &fw2, NULL);
4670 fail_if(fw2 <= fw1);
4671 efl_text_markup_set(txt,text3);
4672 efl_canvas_text_size_native_get(txt, &fw3, NULL);
4673 fail_if(fw3 <= fw2);
4674
4675 END_EFL_CANVAS_TEXT_TEST();
4676}
4677EFL_END_TEST
4678
4679
4657EFL_START_TEST(efl_text_font) 4680EFL_START_TEST(efl_text_font)
4658{ 4681{
4659 START_EFL_CANVAS_TEXT_TEST(); 4682 START_EFL_CANVAS_TEXT_TEST();
@@ -4715,6 +4738,7 @@ void evas_test_textblock(TCase *tc)
4715 tcase_add_test(tc, efl_text); 4738 tcase_add_test(tc, efl_text);
4716 tcase_add_test(tc, efl_canvas_text_cursor); 4739 tcase_add_test(tc, efl_canvas_text_cursor);
4717 tcase_add_test(tc, efl_canvas_text_markup); 4740 tcase_add_test(tc, efl_canvas_text_markup);
4741 tcase_add_test(tc, efl_canvas_text_markup_invalid_escape);
4718 tcase_add_test(tc, efl_text_font); 4742 tcase_add_test(tc, efl_text_font);
4719} 4743}
4720 4744