summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-06-26 23:52:23 +0200
committerSébastien Helleu <flashcode@flashtux.org>2023-06-27 21:28:24 +0200
commitb551d6f247a4234ea425cc23eb9d57ea61f7d179 (patch)
treef3cc3e177447b10fd274b94e958534aad8e0b8b9 /tests/unit
parent4c9fd4a625af706604678db33d8fa9cf62311e28 (diff)
downloadweechat-b551d6f247a4234ea425cc23eb9d57ea61f7d179.zip
core: check for newline characters in string_is_whitespace_char
This fixes a bug where if you had multiple lines in the input and pressed ctrl-w when the cursor was after the first word of any line but the first, it would delete both the word before the cursor and the last word on the preceding line.
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/core/test-core-string.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/unit/core/test-core-string.cpp b/tests/unit/core/test-core-string.cpp
index 876e71c0a..465276c66 100644
--- a/tests/unit/core/test-core-string.cpp
+++ b/tests/unit/core/test-core-string.cpp
@@ -1090,6 +1090,8 @@ TEST(CoreString, IsWhitespaceChar)
LONGS_EQUAL(1, string_is_whitespace_char (" abc def"));
LONGS_EQUAL(1, string_is_whitespace_char ("\tabc def"));
+ LONGS_EQUAL(1, string_is_whitespace_char ("\nabc def"));
+ LONGS_EQUAL(1, string_is_whitespace_char ("\rabc def"));
}
/*