summaryrefslogtreecommitdiff
path: root/test/src
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-09-27 02:01:03 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2020-09-27 02:01:03 +0200
commit8c569683f2ee5d14040f5605fd0570b2eb009c05 (patch)
tree913a8be96d0b7057797ab7b394fba184cdd1b2f8 /test/src
parent8a148c5976e3fad53d540ce5aa52a36c6b658f85 (diff)
downloademacs-8c569683f2ee5d14040f5605fd0570b2eb009c05.tar.gz
Fix searching for multibyte needles in unibyte haystacks
* src/fns.c (Fstring_search): Make this work better when searching unibyte haystacks for multibyte needles (bug#43598).
Diffstat (limited to 'test/src')
-rw-r--r--test/src/fns-tests.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el
index f2e1a268b08..41969f2af2c 100644
--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -953,4 +953,8 @@
(should (equal (string-search "" "abc" 3) 3))
(should-error (string-search "" "abc" 4))
(should-error (string-search "" "abc" -1))
- )
+
+ (should-not (string-search "ΓΈ" "foo\303\270"))
+ (should (equal (string-search (string-to-multibyte "o\303\270") "foo\303\270")
+ 2))
+ (should (equal (string-search "\303\270" "foo\303\270") 3)))