[nautilus] eel: string: fix middle truncation test cases
- From: Ernestas Kulik <ernestask src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] eel: string: fix middle truncation test cases
- Date: Wed, 21 Mar 2018 08:07:48 +0000 (UTC)
commit 3e3bd830b5ea14fc4bbfe3933d67d79fd906f190
Author: Ernestas Kulik <ernestask gnome org>
Date: Wed Mar 21 10:04:39 2018 +0200
eel: string: fix middle truncation test cases
f42979f0b073d96a9157c05c0bff963820a630b4 changed the ellipsis to a
unicode one, which is one character in length, in turn changing the
expected output.
For cases where the truncation length is zero, the expected output is
changed to NULL, as 536505728e3963cfc6d2fa93ca2b188bfb5a144b added an
assertion.
eel/eel-string.c | 44 ++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)
---
diff --git a/eel/eel-string.c b/eel/eel-string.c
index d7e31988e..1fa480c24 100644
--- a/eel/eel-string.c
+++ b/eel/eel-string.c
@@ -479,39 +479,39 @@ eel_self_check_string (void)
EEL_CHECK_STRING_RESULT (eel_str_capitalize ("foo"), "Foo");
EEL_CHECK_STRING_RESULT (eel_str_capitalize ("Foo"), "Foo");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("foo", 0), "foo");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("foo", 0), NULL);
EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("foo", 1), "foo");
EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("foo", 3), "foo");
EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("foo", 4), "foo");
EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("foo", 5), "foo");
EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("foo", 6), "foo");
EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("foo", 7), "foo");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("a_much_longer_foo", 0), "a_much_longer_foo");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("a_much_longer_foo", 0), NULL);
EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("a_much_longer_foo", 1), "a_much_longer_foo");
EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("a_much_longer_foo", 2), "a_much_longer_foo");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("a_much_longer_foo", 3), "a_much_longer_foo");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("a_much_longer_foo", 4), "a_much_longer_foo");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("a_much_longer_foo", 5), "a…o");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("a_much_longer_foo", 6), "a…oo");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("a_much_longer_foo", 7), "a_…oo");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("a_much_longer_foo", 8), "a_…foo");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("a_much_longer_foo", 9), "a_m…foo");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_even", 8), "so…ven");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_odd", 8), "so…odd");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_even", 9), "som…ven");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_odd", 9), "som…odd");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_even", 10), "som…even");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_odd", 10), "som…_odd");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_even", 11), "some…even");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_odd", 11), "some…_odd");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_even", 12), "some…_even");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_odd", 12), "some…g_odd");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_even", 13), "somet…_even");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("a_much_longer_foo", 3), "a…o");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("a_much_longer_foo", 4), "a…oo");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("a_much_longer_foo", 5), "a_…oo");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("a_much_longer_foo", 6), "a_…foo");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("a_much_longer_foo", 7), "a_m…foo");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("a_much_longer_foo", 8), "a_m…_foo");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("a_much_longer_foo", 9), "a_mu…_foo");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_even", 8), "som…even");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_odd", 8), "som…_odd");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_even", 9), "some…even");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_odd", 9), "some…_odd");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_even", 10), "some…_even");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_odd", 10), "some…g_odd");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_even", 11), "somet…_even");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_odd", 11), "somet…g_odd");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_even", 12), "somet…g_even");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_odd", 12), "somet…ng_odd");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_even", 13), "someth…g_even");
EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_odd", 13), "something_odd");
EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_even", 14), "something_even");
EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_odd", 13), "something_odd");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("ääääääääää", 5), "ä…ä");
- EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("あぃいぅうぇえぉ", 7), "あぃ…えぉ");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("ääääääääää", 5), "ää…ää");
+ EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("あぃいぅうぇえぉ", 7), "あぃい…ぇえぉ");
EEL_CHECK_STRING_RESULT (eel_str_strip_substring_and_after (NULL, "bar"), NULL);
EEL_CHECK_STRING_RESULT (eel_str_strip_substring_and_after ("", "bar"), "");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]