mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-25 02:36:07 +00:00
eel: string: fix middle truncation test cases
f42979f0b0
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, as536505728e
added an assertion.
This commit is contained in:
parent
a01652064a
commit
3e3bd830b5
|
@ -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"), "");
|
||||
|
|
Loading…
Reference in a new issue