Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Two more cases added: - punctuation at the end of the last word of the cut sentence means there is nothing to process (should fix partial); - make sure a line that is not too long is not trimmed.

NyanKiyoshi2cbdee9b9de4
diff --git a/tests/test_core.py b/tests/test_core.py
index 1e227bab33..a11f3ec9f3 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -173,6 +173,8 @@ def test_utils_get_last_stop_char():
def test_trim_fullword():
+ assert trim_fullword('it\'s too long. but period.', 14) == 'it\'s too long'
+ assert trim_fullword('it\'s not too long.', 50) == 'it\'s not too long.'
assert trim_fullword('don\'t break', 10) == 'don\'t'
assert trim_fullword('this is a sentence', 5) == 'this'
assert trim_fullword('thisIsTooLongJustCutIt', 4) == 'this'